Dennis
  • Member for 8 years
  • Last seen more than a week ago
Talk interpreter
Accepted answer
24 votes

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=...

View answer
Prime Difference
2 votes

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 ...

View answer
Equal, sum or difference!
6 votes

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 ...

View answer
What are the repeating Fibonacci Digits?
11 votes

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....

View answer
How many consecutive descending numbers in my number?
2 votes

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!

View answer
How many consecutive descending numbers in my number?
3 votes

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. ...

View answer
Find if a list is an ABC-triple
8 votes

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], ...

View answer
Collapsing numbers
5 votes

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 ...

View answer
Generate Monday Numbers
Accepted answer
3 votes

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 ...

View answer
Generate Monday Numbers
2 votes

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 ...

View answer
Count the contiguous submatrices
5 votes

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
Clock Hand Syzygy
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
Eight coins for the fair king
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
"Hello, World!"
1 votes

ABC, 21 bytes WRITE "Hello, World!" Try it online!

View answer
Does this Set Represent a Natural Number?
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
Does this Set Represent a Natural Number?
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
Smallest Diversifying Exponent
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
Smallest Diversifying Exponent
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
Parse the Bookworm dictionary format
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
Coat of Many Colours
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
Non-overlapping Matrix Sum
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
How many syllables in that number?
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
How many syllables in that number?
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
Convert to Suzhou numerals
Accepted answer
1 votes

Jelly, 35 bytes 9Ḷ;-26ż“/Ẉ8‘+⁽ȷc¤ṃ@ɓD_2ỊŒgÄFị"+⁽-FỌ Try it online!

View answer
How much candy can you eat?
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
Optimal Alphabet Stepping
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
Optimal Alphabet Stepping
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
"As we travel the universe..."
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
Trifid Cipher (without keyword)
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. ...

View answer
P Pr Pre Pref Prefi Prefix Prefixe Prefixes
7 votes

Jelly, 3 bytes ṭṖƤ Try it online! How it works ṭṖƤ Main link. Argument: A Ƥ Map the link to the left over all non-empty(!) prefixes of A. Ṗ Pop; remove the last element. ṭ Tack; ...

View answer
1
2 3 4 5
91