ServiceNow interview question

Regular Leetcode algorithms were asked