codeforces problem to shift the keyboard Right or left, all tests passing