3
Comments
  • 0
    For anyone missing context, I worked on this for a solid hour condensing it to one line and I kept looking back to my friends solution and absolutely lost it when looking to my own single line.
  • 1
    I wonder if there is a better mathematical solution to this problem... Something like O(n) or O(1)...
  • 0
    @react-guy if you can find a better solution I'll update my single line :p
  • 0
    @BitWise probably not. The solution requires to factor the number which is kwown to be not feasible in O(1) (crypto etc).
Add Comment