G-Research interview question

Leetcode Easy in screening round