link to ide: https://ide.codingblocks.com/s/367848
Code fails in 2,3,4 case
hello @himanshu_goyal
check the constraints , we will have 250 digit number in worst case which we cant store in any primitive datatype(overflow will happen).
so u need to store numbers as strings and then compute gcd by applying string manipulation technuiques
code for refrence->
Oh I forgot that point. Thank you Aman