Day 5

Today I solved a number of relatively tougher problems on Arrays and Subarrays. They were really tricky and I got a couple of new things to learn as well. The most important thing I learned was how to approach towards making the logic for the problem, keeping the time and space constraints in mind. Which problem will require an O(n) or O(n log n) solution and which O(n^2) solution.

I practiced the following problems today:

  • PRINTING ALL SUBARRAYS OF GIVEN ARRAY OF SIZE N
  • FIND MAXIMUM SUM FROM ALL SUBARRAYS OF AN ARRAY
  • FIND SMALLEST POSITIVE MISSING NUMBER FROM AN ARRAY (The solution of this one was quite unique)
  • FIND FIRST OCCURENCE OF A REPEATING ELEMENT.

PS: Tomorrow is the Round A of Google Kickstart 2021. I hope to do well.

Leave a comment

Design a site like this with WordPress.com
Get started