New answers tagged

0 votes

Miller-Rabin Recursive Primality Test

The code isn't tail recursive so you actually have to pay for the recursion with stack and function calls. You can turn this iterative if you start at the highest bit and work your way down to the ...
user avatar
2 votes

Boolean evaluation

Time complexity cannot be \$n^3\$. There are just too many ways to parenthesize the string, and the code inspects them all. I run an experiment counting a number of calls to ...
user avatar
  • 53.4k
1 vote

Coin partitions

The readability is fine. If you cut out the documentation it's about 15 lines long, and short is almost always readable. Replace coins.sort with ...
user avatar

Top 50 recent answers are included