Jakube
  • Member for 7 years, 6 months
  • Last seen this week
Can't see the forest for the keys
Accepted answer
6 votes

Pyth, 48 bytes j_.t+sm.i,J\_?d++\|sm?>d0\ \|d\^Jms+Jmkd"/\\"QJd Try it online: Demonstration or Test Suite Too lazy for a full explanation. Here just short overview: I generate the columns ...

View answer
Partition into increasing subsequences
1 votes

Pyth, 20 bytes fTu&ahfSI+THGHGQm[)Q Try it online: Demonstration or Test Suite Greedy approach. I create len(input) empty lists. Then I iterate over each number in the input an choose the first ...

View answer
Hilbert Primes Golf
Accepted answer
3 votes

Pyth, 21 bytes Lh*4bye.fqZf!%yZyT1hQ Try it online: Demonstration or Test Suite Explanation: Lh*4bye.fqZf!%yZyT1Q implicit: Q = input number L define a function y(b), ...

View answer
Thanksgiving Turkey
Accepted answer
3 votes

Pyth, 23 bytes mc*vXzG\*dsN=N-/R\|C.z0 This doesn't work in the online version, because it uses eval to determine the size of the turkey. Explanation: mc*vXzG\*dsN=N-/R\|C.z0 implicit: z = ...

View answer
Sum pyramid of primes
5 votes

Pyth, 18 bytes husM.:G2tQ.f}ZPZQ0 Try it online: Demonstration Explanation: husM.:G2tQ.f}ZPZQ0 implicit: Q = input number .f Q0 find the first Q numbers Z >= 0, which satisfy ...

View answer
Write out the Thue-Morse sequence
Accepted answer
14 votes

Pyth, 6 bytes xMjR2Q Try it online: Demonstration Based on the solution from @ThomasKwa and a variation of @FryAmTheEggman. It uses the following formular: the i-th digit in the Thue-Morse ...

View answer
Well that's odd... no wait, that's even!
28 votes

Pyth, 16 14 bytes @"eo".vjdXzGU9 Pyth can itself evaluate a string, that is in Pyth syntax. Therefore I replace e and o with 4 and 5. Then the evaluation will give me an even or odd number, and I ...

View answer
Running length of the movie in a human readable format
1 votes

Pyth, 35 bytes jds.b,N+WtNY\s.Ds-zG60c"hour minute Try it online: Demonstration or Test Suite Explanation: jds.b,N+WtNY\s.Ds-zG60c"hour minute implicit: z = input string -zG ...

View answer
Is q a quadratic residue of n?
Accepted answer
7 votes

Pyth, 9 bytes }Em%*ddQQ Try it online: Demonstration or Test Suite Explanation: }Em%*ddQQ implicit: Q = first input number m Q map all numbers d of [0, 1, ..., Q-1] to: *dd d*d ...

View answer
Happy Fibonacci Day!
Accepted answer
2 votes

Pyth, 31 bytes jaPJ_.ts_BuaaGks>4GtQ]\idXeJ" _ Try it online: Demonstration Explanation: jaPJ_.ts_BuaaGks>4GtQ]\idXeJ" _ implicit: Q = input number u tQ]\i reduce ...

View answer
Triangulating Text
Accepted answer
9 votes

Pyth, 22 bytes jua+L\ GjdHfTczsM._UzY Try it online: Demonstration or Test Suite Explanation: jua+L\ GjdHfTczsM._UzY implicit: z = input string Uz create the list [0, 1, ......

View answer
N Slab Slanted Slash Cake
Accepted answer
10 votes

Pyth, 25 bytes j_+t.iJ*R"/ "SQ+L\\J*Q"/\ Try it online: Demonstration or Test Suite Explanation: j_+t.iJ*R"/ "SQ+L\\J*Q"/\ implicit: Q = input number SQ create the list [...

View answer
Josephus problem with three inputs
Accepted answer
5 votes

Pyth, 16 bytes eu.<PGvzh-QvwShQ Try it online: Demonstration or Test Suite Input is of the form k<newline>n<newline>q. Explanation: eu.<PGvzh-QvwShQ implicit: z = first input ...

View answer
Find maximal matching in divisibility relation
3 votes

Pyth, 13 bytes eSm/%Mcd2Z.pQ The time and storage complexity is really terrible. The first thing I do is to create a list with all permutations of the originally list. This takes n*n! storage. Input ...

View answer
Draw the national flag of France
24 votes

Pyth, 27 bytes .w*52[smmdGc3CM"\0U¤ÿÿÿïA5 There are some unprintable chars, so here's a hexdump: 00000000 2E 77 2A 35 32 5B 73 6D 6D 64 47 63 33 43 4D 22 .w*52[smmdGc3CM" 00000010 5C 30 55 ...

View answer
Count up forever
13 votes

Pyth, 4 bytes .V1b Explanation: .V1 for b in range(1 to infinity): b print b

View answer
Code Billiards (Levenshtein golf)
7 votes

Pyth, score 489 Base conversion: 15 s@L+s`MTrG1jQ36 Caesar Cipher: 13 + 11^1.5 u.rGHrBG1z 36 Divisible by 1738: 7 + 11^1.5 !%Q1738 First N positive integers: 8 + 8^1.5 *Rs@Q2SQ Sum of prime ...

View answer
Letters between two letters
5 votes

Pyth, 19 bytes lfqF-MSMCT.cCUBCMz2 Try it online: Demonstration Explanation: lfqF-MSMCT.cCUBCMz2 z read a string from input CM convert into list of ascii-...

View answer
Biplex: an important useless operator
11 votes

Pyth, 26 25 bytes JsM.T_MjR2Qi_}RhM_BS-J0J2 Try it online: Demonstration or Test Suite Explanation JsM.T_MjR2Q jR2Q convert each input number to binary (lists of 1s and 0s) _M ...

View answer
Imitate an ordering
6 votes

Pyth, 10 bytes @LSvzxLSQQ Try it online: Demonstration Explanation @LSvzxLSQQ implicit: z = first input line as string Q = second input line evaluated SQ sorted(Q) ...

View answer
Sort this, quick!
4 votes

Pyth, 25 bytes L?tbsyMa_,]JObf<TJbf>TJbb This defines a function y, that takes a list of numbers as input. Try it online: Demonstration Explanation L?tbsyMa_,]JObf<TJbf>TJbb L ...

View answer
Code Golf: Forwards sdrawkcaB sdrawkcaB Forwards Forwards sdrawkcaB
0 votes

Pyth, 55 bytes ?--rz0Gd"Sentence must only use letters"jd.e_W%%k4 3bcz Borrowed the %%k4 3 bit from Pietu1998. Saved one additional byte. Try it online: Demonstration or Test Suite Explanation ?-...

View answer
Counting and spelling up
Accepted answer
11 votes

Pyth, 19 bytes sXzsJ+rBG1jkUTs._MJ Try it online: Demonstration or Test Suite Explanation sXzsJ+rBG1jkUTs._MJ rBG1 the list ["abc...xyz", "ABC...XYZ"] + jkUT ...

View answer
Calculate the bounded cumulative sum of a vector
Accepted answer
5 votes

Pyth, 14 bytes t.u@S+Q+NY1vwZ Try it online: Demonstration or Test Suite Explanation t.u@S+Q+NY1vwZ implicit: Q = first input list [upper_lim, lower_lim] .u vwZ for each number Y in the ...

View answer
Solving less-than inequalities with positive integers
Accepted answer
4 votes

Pyth, 39 bytes V>1f.A<MxMLTN.pS{s=Nm%2cd).zVNjd[H\==hZ Try it online: Demonstration Brute-forces through all possible permutations (and interpret them as sortings), check if they match the ...

View answer
2D Inequalities
Accepted answer
3 votes

Pyth, 46 bytes juCms.iJ-d\ m.x@H._-FsMk\ .:J2Gc2"=><\"v^"%2.z Try it online: Demonstration

View answer
Remove all occurrences of the first letter of a string from the entire string
Accepted answer
9 votes

Pyth, 7 bytes -zrBhz2 Try it online: Demonstration or Test Suite Nice. The new bifurcate operator (only 8 days old) helps here to save one char. I think this is the first code, that uses this ...

View answer
Iterated partial sums
4 votes

Pyth, 9 bytes usM._GvwQ Try it online: Demonstration or Test Suite Explanation usM._GvwQ implicit: Q = input list vw input number u Q repeat the following instruction ^ times to G =...

View answer
The Mystery String Printer (Robbers)
1 votes

Pyth, ConfusedMr_C, ≤ 32 sm*2s_c4s_Mcd2%2_c4sCM127 Only needed 25 chars. Took some while though. Try it online: Demonstration The idea is to take all chars of the ranges 32-63 und 96-126 (Yes, ...

View answer
*Overwrit*labels
4 votes

Pyth, 20 bytes V.Tmrj" *"d9Qpe+d-Nd Try it online: Demonstration or Test Suite Explanation V.Tmrj" *"d9Qpe+d-Nd m Q map each pair d of the input to: j" *"d join ...

View answer
1 2 3
4
5
11