Getting wrong answer on two testcases. only one test case is correct
code link.
Getting wrong answer on two testcases. only one test case is correct
code link.
Just change all occurrences of int with long long int as the constraints might be a little bigger than mentioned in the question. Then your code should work just fine.
Hope it Helps.
Thank you bro. It worked.