We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Project Euler #14: Longest Collatz sequence
Project Euler #14: Longest Collatz sequence
Sort by
recency
|
207 Discussions
|
Please Login in order to post a comment
My solution in Python worked for most of the test cases. Thing is, it didn't work on 4 of the test cases, and it seems like it just wants some hyper-optimizations that would end up being memory inefficient and weird. Seems like a pretty unfair set of test cases tbh.
out put for 20 terms is 18 please change it
Am I the only one facing problem with this code.... Starting number with the longest Collatz sequence up to 20 is 18 but why is the compiler expecting the answaer to be 19? 18>9>28>14>7>22>11>34>17>52>26>13>40>20>10>5>16>8>4>2>1
Can anyone help reduce runtime of this code