GOAT Group interview question

Technical Call: Medium Leetcode question