Extra Characters in a String | Leetcode 2707