Added ArrayList<String> to solve in all the questions