My code works well for all tests except tests 14, 15 and 5.
Lets take test 5 as sample.
for n = 151042752, I entered from p=1 to p=17 where the calculated number reaches upper limit of Long. And among these p inputs; I've never get 3263 which the number I got from the error of code's attempt output instead of -1 this made me confused please help. Same thing for test 14 and 5.
Well I'm impressed of your solution to find LCM totally efficient way congrats!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
My code works well for all tests except tests 14, 15 and 5.
Lets take test 5 as sample.
for n = 151042752, I entered from p=1 to p=17 where the calculated number reaches upper limit of Long. And among these p inputs; I've never get 3263 which the number I got from the error of code's attempt output instead of -1 this made me confused please help. Same thing for test 14 and 5.
This comment is hidden because it contains spoiler information about the solution