Remotebase interview question

Q: High difficulty DS Problems.