Uber interview question

Something to do with matrices and string manipulation. (Def leetcode medium)