problem linkB] submission link
I am getting the right answer when running the testcases locally however codeforces when running the code on their servers gives a different output. Can anyone explain what's happening here. Any help is appreciated. Thanks.