My code is only passing 4/6 test cases?

@Ak07
here, It is working fine now. You had to iterate till 1e8 values.