Please check my code and tell my why is it giving WA on last test case
Why is my code giving WA on last test case?
@HemantKumar
You have not red question properly. You can move to any of 8 adjacent characters. Consider this example
2
a abcd
2
ac
db
here output should be “a abcd”. we can make “abcd” by moving in this way. { (0,0) -> (1,1) -> (0,1) -> (1,0) }.