Silversheet interview question

1hr Coderpad Hackerrank style problem