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.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

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

Okay