My code takes all number combinations in the test cases and checks their LCM and prints the least one.
I saw other solutions, they were pretty much similar and gave same results but mine is not being accepted, plz help
My code takes all number combinations in the test cases and checks their LCM and prints the least one.
I saw other solutions, they were pretty much similar and gave same results but mine is not being accepted, plz help
Does your lcm function works correct? I feel that if i pass x=2 and y=3 to it, it will return 1 which isnt true.
Yes, you are right. This line is unnecessary and causes wrong results
if(x/y == 1){return x;}