New answers tagged

2 votes

Fix my FizzBuzz

Python 3.8 (pre-release), 149 bytes ...
user avatar
  • 6,359
3 votes

Fix my FizzBuzz

Charcoal, 55 bytes WS⊞υι⮌⊟ΦE⁷EEυ⁻⁺⌈EυΣ⁺ψνκμ∨⁺⎇﹪λ³ωFizz⎇﹪λ⁵ωBuzzIλ⬤ι⁼№ιλ№υλ Try it online! Link is to verbose version of code. Explanation: ...
user avatar
  • 145k
2 votes

Fix my FizzBuzz

05AB1E, 28 bytes ∞εD35SÖƶ(O‚0Kθ}Ig„üÿ.V.Δ{I{Q Not too happy about this.. I have the feeling this can be a lot shorter.. :/ Try it online or verify all test cases. ...
user avatar
3 votes

Fix my FizzBuzz

JavaScript (ES6), 82 bytes Saved 2 bytes thanks to a suggestion by @emanresuA Expects and returns -1 for Fizz, -2 for Buzz, <...
user avatar
  • 168k
1 vote

Fix my FizzBuzz

Python3, 276 bytes: ...
user avatar
  • 3,026
11 votes

Fix my FizzBuzz

Vyxal, 21 15 bytes ṖÞ∞ƛ₍₃₅T∨;ÞS$↔h Try it Online! Why use clever mathematics when you can just generate infinite FizzBuzz? -6 thanks to Steffan and emanresuA ...
user avatar
  • 22.1k
6 votes

Fix my FizzBuzz

J, 54 bytes (-:&(/:~)"1#])#]\1((,~{~0=])2-@#.0=5 3|])@+#i.@+9>.>./ Try it online! _1, _2, _3 represent Fizz, Buzz, FizzBuzz. Generate all integers ...
user avatar
  • 27.2k
2 votes

Implement the slowest possible sorting algorithm that retains a fast best case

Python 3, \$O\left(n^2\left(max\left(a\right)-min\left(a\right)+1\right)^{n-1}\right)\$ ...
user avatar
  • 29.4k
1 vote

Implement Sleep Sort

C (clang), 72 bytes main(n){~scanf("%d",&n)?fork()?wait(main()):printf("%d ",n+sleep(n)):0;} I chose clang but it also works on gcc. ...
user avatar
3 votes

Implement Sleep Sort

JavaScript, 38 bytes a=>a.map(x=>setTimeout(alert,x*1e3,x))
user avatar
  • 6,410
2 votes

Implement Sleep Sort

Rust, 125 bytes Used the depricated sleep_ms function so I don't need to write a long duration. ...
user avatar
  • 923
1 vote

Sort odd numbers first

Vyxal, 2 bytes µ₂ Try it Online! µ # Sort by... ₂ # Even?
user avatar
  • 30.5k
0 votes

Sort odd numbers first

Zsh, 31 bytes grep [02468]$<i grep [13579]$<i Attempt This Online! Takes input from a file called i.
user avatar
  • 21.3k
3 votes

Reverse odd runs

Desmos, 94 93 bytes g(M,j)=j-max([1...j]0^{mod(M,2)}) f(L)=L[[i+g(L[n...1],n+1-i)-g(L,i)fori=[1...n]]] n=L.length Try it on Desmos! *-1 byte thanks to @AidenChow (...
user avatar
1 vote

Reverse odd runs

Factor + grouping.extras, 62 bytes [ [ odd? ] group-by [ last2 swap [ reverse ] when ] map-flat ] Attempt This Online!
user avatar
  • 10.2k
3 votes

Reverse odd runs

Desmos, 167 bytes ...
user avatar
  • 4,669

Top 50 recent answers are included