Skip to main content
8 votes

Finding a sequence of xors to change a to b

You can improve the performance by using an \$O(1)\$ algorithm. Turn all the bits on. ...
Peilonrayz's user avatar
  • 44.5k
4 votes

Project Euler #909: L-Expressions I

Analyze looking for intelligence One answer already mentioned that your approach is basically brute force. This is due to simply iterating through all. Looking at the possible steps: A(u) → u+1 Z(u)(...
Joop Eggen's user avatar
  • 4,636
3 votes

Prime factorization for integers with up to 9-digit long prime factors

I would look up the pollard-rho algorithm. It doesn’t involve any higher mathematics, so you can implement it yourself. If a number n has a prime factor p, that prime factor can be found in about sqrt(...
gnasher729's user avatar
  • 2,970
3 votes

Project Euler #909: L-Expressions I

I don't spend a lot of time on Code Review, but I noticed this question in HNQ and let it stew in the background for a month or so before I found a solution. This answer isn't a review of the code in ...
phoog's user avatar
  • 296
2 votes

Two solutions to LeetCode 127 Word Ladder

...
Chris's user avatar
  • 4,329
1 vote

Two solutions to LeetCode 127 Word Ladder

Here are some general coding style suggestions. Comments Remove all commented-out code to reduce clutter: ...
toolic's user avatar
  • 15.7k

Only top scored, non community-wiki answers of a minimum length are eligible