problem link: https://atcoder.jp/contests/dp/tasks/dp_f
1 Like
Your code giving wa for this input
azbz
zabz
your answer=az
correct answer=zbz
2 Likes