This is my submission link for the problem => https://atcoder.jp/contests/abc344/submissions/51105707 I have tried hours debugging it but cannot seem to find where is the implementation or the logic is wrong Please if anyone could give some of their valuable time and help me out here
The problem link -> https://atcoder.jp/contests/abc344/tasks/abc344_d