Wrong answer - ALEXTASK

Challenge (ALEXTASK)

My Code (C)

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.

1 Like

Yes, you are right. This line is unnecessary and causes wrong results

if(x/y == 1){return x;}

Yup, on the very first look itself it seemed a bit off. Thanks for verification @meooow !! :slight_smile: