Newest Questions
14,497 questions
11 votes
3 answers
296 views
Minimum width to connect both sides
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-...
0 votes
1 answer
83 views
Golf a number bigger than all other answers [duplicate]
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 ...
-7 votes
1 answer
89 views
Quine for both C++ and python [closed]
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, ...
-7 votes
0 answers
133 views
Buscar (a,b,c) que cumpla a!*b! /c! = 1 [closed]
Find all triples (a,b,c) that satisfy (a! * b!) / c! = 1 The following non-trivial combinations were found in the first 50 numbers: (3! * 5!) / 6! = 1 (4! * 23!) / 24! = 1 (6! * 7!) / 10! = 1 In ...
-1 votes
1 answer
122 views
Generare a toothbrush diagram [closed]
Given a String of opening brackets and the letter G, such that it makes a applicative tree of the leaf node G and ( representing ...
8 votes
4 answers
570 views
Find a primitive polynomial
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 ...
4 votes
1 answer
187 views
Through maze with a compressed guide
Given a wall maze of 50x50, exactly same generating algorithm, at different RNG, so every two positions are connected by exactly one path, etc. Write two functions: One takes the maze as input and ...
4 votes
1 answer
108 views
Python Buckshot Roulette KOTH
What is Buckshot Roulette? Buckshot Roulette is an indie game, released by Mike Klubnika to itch.io in 2023. Okay, but how do you play? To quote from the wiki: "At its core, Buckshot Roulette is ...
14 votes
10 answers
975 views
Polynomial Basis Conversion
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 ...
17 votes
18 answers
1k views
Order a list by the difference of its elements
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 ...
2 votes
0 answers
172 views
Through maze with a hint
Given a wall maze of 50x50, write two functions: One takes the maze as input and returns a positive integer; The other takes the integer and walk through the maze from left-top to right-bottom. At ...
11 votes
7 answers
604 views
Sticks expectation
This was originally a question from interviewstreet.com over a decade ago You are given an array (or whatever - your choice of input) of positive integers \$y_1,\ldots,y_n\$ that represents \$n\$ line ...
18 votes
8 answers
1k views
English to Dutch number order conversion
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 ...
11 votes
17 answers
916 views
Identify Redundant Regex
A redundant regular expression (regex) is defined here as a regex which has some amount of characters which can be removed while not affecting its functionality -- i.e. it matches the exact same set ...
8 votes
8 answers
967 views
Validate DNA Sequences with Telomeres
This is inspired by this homework assignment. Telomeres are regions of repetitive DNA sequences that occur at the ends of linear chromosomes in eukaryotes (such as humans and other mammals). In ...