LRDTech interview question

Some random leetcode question that they probably got online.