Innovaccer interview question

Some Hard Level DSA Question from Leetcode