Solve sliding window, heap, DP, in-place tasks | Salesforce Interview Question