ServiceNow Interview Question

Q: 2 leetcode style problems