DEV Community

Rishitha Nallapureddy
Rishitha Nallapureddy

Posted on • Edited on

Programming journey- 8-11-24

Hi everyone! Today, I solved three problems on LeetCode: Jump Game, Triangle, and Min Stack. In both the Jump Game and Triangle problems, we have to find an efficient logic to solve them. In the Min Stack problem, we need to use the stack data structure. Always make sure to review the problems you've completed at least once a week. This will help you connect previously learned concepts with newly learned ones.

The algorithm used to determine the solution of the problem Jump Game reads through input array, keeps track of the farthest index accessible, and checks whether a jump can cover the final index of the input. If it's possible then return true. Otherwise return false.

In solving the Triangle problem, nested for loops can be employed to travel through the triangle and to find the smallest element on each level of the triangle. We include these minima in total. Thus, we would be able to solve the problem with this approach.
In the Min Stack problem, we will implement a stack and come up with some methods, namely, push, pop, top, and getMin. In doing so, this is helpful in solving our problem easily.

I hope my experience is helpful to you.

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

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

Okay