SoFi interview question

OA leetcode easy to medium