Hi All,

Recently in a Online Hackathon, I came across the below 2 questions. I could solve them and passed half of the test cases but encountered Exceeded Time Limit for the rest of the test cases. Would really appreciate if somebody could point me to the optimal solutions.

  1. image
    image
  2. image
    image
Comments (4)