Tredence Interview Question

Leetcode Hard question in DSA OT round