DEV Community

Rishitha Nallapureddy
Rishitha Nallapureddy

Posted on

Journal - 19-11-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.

Image of Datadog

Master Mobile Monitoring for iOS Apps

Monitor your app’s health with real-time insights into crash-free rates, start times, and more. Optimize performance and prevent user churn by addressing critical issues like app hangs, and ANRs. Learn how to keep your iOS app running smoothly across all devices by downloading this eBook.

Get The eBook

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