Dennis
• Member for 8 years
• Last seen more than a week ago

Jelly, 3 bytes y@/ Input is a single list: the accumulator, followed by the pairs. Try it online! How it works The y atom performs transliteration; [a,b]yc replaces a with b, so it returns b if a=...

Jelly, 8 bytes 2Æn:+ɗ1# Try it online! How it works 2Æn:+ɗ1# Main link. Argument: n 2 Set the return value to 2. 1# Find the first k ≥ 2 such that the link to the left, called ...

Jelly, 7 bytes +,ạ5eo= Try it online! How it works +,ạ5eo= Main link. Arguments: x, y (integers) + Yield x+y. ạ Yield |x-y|. , Pair; yield (x+y, |x-y|). 5e Test if 5 ...

Jelly, 15 bytes DFṫ-SṭḊ d⁵ÇÐḶZḢ Try it online! How it works d⁵ÇÐḶZḢ Main link. Argument: n (integer) d⁵ Divmod 10; yield [n:10, n%10]. ÇÐḶ Call the helper link until a loop is reached....

Python 2, 95 bytes lambda n:max(j-i for j in range(n+1)for i in range(-1,j)if''.join(map(str,range(j,i,-1)))==n) Another slow, brute-force solution. Try it online!

Jelly, 11 bytes ŒṖḌ’Dɗ\ƑƇẈṀ Byte for byte, no match for the other Jelly solution, but this one should be roughly $O\left(n^{0.3}\right)$. Try it online! How it works ŒṖḌ’Dɗ\ƑƇẈṀ Main link. ...

Jelly, 10 9 bytes Ṫ=S×</=g/ Try it online! How it works Ṫ=S×</=g/ Main link. Argument: [a, b, c] (positive integers) Ṫ Tail; pop and yield c. S Take the sum of [a, b], ...

Jelly, 11 bytes DŒg+2/€FVµ¡ This is an unnecessarily slow, full program. Try it online! Alternate version, 12 bytes DŒg+2/€FVµƬṪ One byte longer, but much faster. Works as a program or a ...

Jelly, 8 bytes ȷ7Dg⁼QƲƇ Runs locally in under eight minutes. Try it online! (modified to find numbers with six digits or less) How it works ȷ7Dg⁼QƲƇ Main link. No arguments. ȷ7 Set the ...

Jelly, 11 bytes 9œ!ṖẎgḌ$ƑƇḌ This uses the two-week old œ! atom. Actually fast enough to run on TIO. Try it online! How it works 9œ!ṖẎgḌ$ƑƇḌ Main link. No arguments. 9 Set the return ...

Jelly, 7 bytes ZẆ$⁺€Ẏċ Try it online! How it works ZẆ$⁺€Ẏċ Main link. Arguments: B, A $Combine the two links to the left into a monadic chain. Z Zip; transpose the matrix. Ẇ ... View answer 2 votes Jelly, 19 16 bytes P:×ⱮP%PĠẈḟ1Sʋ€iƓ Takes the array as argument, the integer from STDIN. Way too slow and memory hungry for most of the test cases. Try it online! Alternate version, 14 bytes P÷€%... View answer 4 votes Jelly, 9 bytes Żœċ8§ḟ’$Ṃ Try it online! How it works Żœċ8§ḟ’$Ṃ Main link. Argument: A (array) Ż Prepend a 0 to A. œċ8 Take all combinations of length 8, with repetitions. § ... View answer 1 votes ABC, 21 bytes WRITE "Hello, World!" Try it online! View answer 2 votes Jelly, 7 bytes Ẉ<Laß€Ạ This is a port of Leaky Nun's Python answer. Since the input has to be a string, this submission is only valid as a full program. Try it online! or verify all test cases ... View answer 3 votes Jelly, 8 bytes ß€Ṣ ÇṖƤƑ Since the input has to be a string, this submission is only valid as a full program. Try it online! or verify all test cases How it works ß€Ṣ Helper link. Argument: A (... View answer 7 votes Python 2, 44 bytes f=lambda n,k=1:11>len(set(k))and-~f(n,n*k) Input has to be a long, as ​k​ behaves differently for longs and ints. Try it online! View answer 0 votes Jelly, 12 11 bytes 1*@ṾØDfƑʋ1# Try it online! How it works 1*@ṾØDfƑʋ1# Main link. Argument: n 1 Set the return value to 1. 1# Call the link to the left for k = 1, 2, ... and ... View answer 2 votes Jelly, 16 bytes ⁹fØDVo©®⁸ḣ;ḟØDµ\ Try it online! How it works ⁹fØDVo©®⁸ḣ;ḟØDµ\ Main link. Argument: A (array of strings) µ\ Cumulatively reduce A by the link to the left. ⁹ ... View answer 7 votes Jelly, 28 bytes “½Ṗ©cƘʂẒẹMMỤẓHP’Œ?“ðÑþQ’,ḥµÞ Try it online! How it works µ turns everything to its left into a monadic chain, which Þ maps over the input array and sorts the input according to the ... View answer 5 votes Jelly, 13 12 bytes ẈŒpQƑƇị"€¹§Ṁ Try it online! Alternate version, 11 bytes ZLœ!Lị"€¹§Ṁ This uses the newly added œ! built-in, which generates all permutations of a given length. Try it online! ... View answer 11 votes Python 2, 84 83 74 67 bytes lambda n:4*(n>99)+2-n%~9/9-0x55561aaaab/4**(n%100)%4+n.count('7') Thanks to @xnor for golfing off 9 16 bytes! Try it online! Python 2, 79 bytes lambda n:4*(n>... View answer 4 votes Jelly, 28 25 23 bytes 9ḊŻ;2+⁵Żċ%ȷ2$ạDṠḄƊ+Dċ7Ɗ Try it online! How it works 9ḊŻ;2+⁵Żċ%ȷ2$ạDṠḄƊ+Dċ7Ɗ Main link. Argument: n (integer in [1, ..., 999]) 9 Set the return value ... View answer Accepted answer 1 votes Jelly, 35 bytes 9Ḷ;-26ż“/Ẉ8‘+⁽ȷc¤ṃ@ɓD_2ỊŒgÄFị"+⁽-FỌ Try it online! View answer 2 votes Jelly, 7 bytes R!²<!ċ0 Try it online! How it works R!²<!ċ0 Main link. Argument: n R Range; yield [1, ..., n]. ! Map factorial over the range. ² Take the squares of the ... View answer 4 votes Jelly, 17 bytes ƓI% 26×þ%iþÇo!SỤḢ Input is a bytestring on STDIN, output is 1-indexed. Try it online! How it works ƓI% Helper link. Argument: m (26 when called) Ɠ Read a ... View answer 4 votes Jelly, 28 26 23 bytes S;þḅ26ŒpṢƑƇIŻ€S:g/ƊÞḢg/ Output is 0-indexed. Input is a bytestring and can be in any case, but uppercase is much faster. Single-letter input has to be special-cased and costs ... View answer 4 votes Jelly, 28 bytes, score = 31 “__ʋ7ṗ“RUu⁽NM\sOSJj[FL‘ḥ1.1* This uses a configurable hashing built-in that I added to Jelly at @lirtosiast's suggestion. Input is in titlecase, output is the power of 1.1 ... View answer Accepted answer 6 votes Jelly, 29 26 25 bytes ⁶Øa;3ṗ¤,©Ṛy;⁶$L3ḍƊ¡ZFs3®y Try it online! How it works ⁶Øa;3ṗ¤,©Ṛy;⁶\$L3ḍƊ¡ZFs3®y Main link. Argument: s (string) ⁶ Set the return value to space. ...