Typed Out String Leetcode Problems Javascript Array Contains