Leetcode Medium Level Arraylist Contains String Js