MacroHealth interview question

easy to medium leet code question. One was solved using two pointers and other one using hashing.