DEV Community

Rishitha Nallapureddy
Rishitha Nallapureddy

Posted on

Journal - 22-10-24

Hi, Folks! Today, I solved three problems on LeetCode : Rotting Oranges, Maximize confusion in exam, and Koko eating Bananas. All these examples are very conceptual and logical. The most important part is to observe that these three problems connect to our real life scenarios.

The problems that are related to real life can easily grasp our attention and easy for visualize. The real life examples will help us to remember the concepts for long time. let me give you a example:

Sliding window maximum is a problem solved using dequeue. When you first read the problem statement, it may seem like a purely mathematical problem involving array of numbers.

Rotting Oranges is another problem solved using dequeue. but, it is framed in a real life situation, which makes the concept more relatable and engaging.

So, now you can clearly observe that the problem related to real life will look more engaging when compared to mathematical problems.

Maximize confusion in exam : In this problem we can traverse through out the provided string and keep track of length. This will help us to interchange the position of Boolean values to get maximum possible length.

I hope my experience is helpful.

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay