ServiceNow Interview Question

Ds mostly focused on heaps and sub array problems