Javascript Array And String Problems Codeforces Ladder