HashedIn by Deloitte interview question

DS related to arrays, string manipulation, recursion