Trending questions

11 votes
3 answers
304 views

Given two sorted lists of same length \$\{a_i\}\$ and \$\{b_i\}\$, find the smallest \$w\$ such that it's possible to connect each pair of points \$(0,a_i)\$ and \$(w,b_i)\$ with paths such that x-...
l4m2's user avatar
  • 32.5k
29 votes
27 answers
5k views

a XAND b a AND b, but not at the same time. I've always found the idea of an XAND gate amusing. Many would claim such a gate can not exist, but I suspect they're just not trying hard enough. ...
Albert Renshaw's user avatar
17 votes
18 answers
1k views

Task Given an unsorted list of integers, order it in such a way that the absolute difference of every two adjacent elements will always be equal to 1: \$|dx| = 1\$ There will be guaranteed one or more ...
Glory2Ukraine's user avatar
14 votes
10 answers
975 views

The most common way to represent a polynomial is writing it as a linear combination of monomials, i.e., powers of the variable. For example, the polynomial \$p(x) = x^3 + 2x^2 + x + 1\$ is a linear ...
alephalpha's user avatar
  • 51.9k
525 votes
1k answers
209k views

So... uh... this is a bit embarrassing. But we don't have a plain "Hello, World!" challenge yet (despite having 35 variants tagged with hello-world, and counting). While this is not the most ...
Martin Ender's user avatar
8 votes
4 answers
570 views

Objective Given a prime number \$p\$ and an integer \$n \geq 2\$, find a degree-\$n\$ primitive polynomial modulo \$p\$. Mathematical explanation When we perform "modular arithmetic" over ...
Dannyu NDos's user avatar
  • 7,371
0 votes
1 answer
83 views

You have to code in python, and the number generated by your code must be bigger than all other current submissions. You need to make your code as small as possible, it has to terminate but you can ...
IAmNotLarry's user avatar
20 votes
31 answers
2k views

Let us define the operation of rebasing a number as writing out its digits in decimal form, then interpreting them in the smallest base N possible (...
SquareFinder's user avatar
21 votes
17 answers
1k views

I was looking for a simple sequence that's not yet referenced on the OEIS and came up with this one(*): \$a_1=2\$ \$a_2=3\$ For \$n>2\$, \$a_n\$ is the smallest number of the form \$a_i\times a_j+...
Arnauld's user avatar
  • 206k
19 votes
30 answers
2k views

Given X>0, return the smallest Y>=0 such that X+Y is a palindrome. Code golf. Tests: 5 => 0 14 => 8 200 => 2 819 => 9 1100 => 11 1122 => 99
Steve Bennett's user avatar
18 votes
8 answers
1k views

Introduction: When saying numbers out loud, the order is slightly different in Dutch than in English. For a number like \$1234\$: in English you'd say: one thousand, two hundred and thirty-four in ...
Kevin Cruijssen's user avatar
15 votes
18 answers
1k views

This is a sequel to Numbers Interpreted in Smallest Valid Base. Let us define the operation of rebasing a number as writing out its digits in decimal form, then interpreting them in the smallest base <...
SquareFinder's user avatar
14 votes
17 answers
1k views

Each quarterback in the NFL is given a passer rating at the end of the game, which measures how good their forward passes were. It is not strictly a basic arithmetic formula, and is calculated as ...
Parcly Taxel's user avatar
  • 4,749
-7 votes
1 answer
89 views

I'm a Chinese so I use AI to translate this question to English,if there was any grammar mistake,please tell me and I'll fix it. You need to write a piece of code that, for the specified language, ...
Ziang Gong's user avatar
18 votes
18 answers
1k views

Write a program/function to output a peg solitaire board in its starting position: ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ○ ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ...
Steve Bennett's user avatar

15 30 50 per page
1
2 3 4 5
967