DEV Community

Rishitha Nallapureddy
Rishitha Nallapureddy

Posted on

Journal - 23-10-24

Hi, Folks! Today, I solved three questions on LeetCode: Maximize greatness in array, Push Dominoes, and Beautiful Arrangements. All these problems may seem tough at first, but using data structures, we can develop a solid logic to solve them easily. With continuous practice, we can improve ability to frame the logics.

As a Beginner, to frame good logic. Firstly, we should have clarity on the problem statement. Next, try to breakdown entire process into small steps and give code to each small step. In this way we can complete the problem. If, we need to see some other approaches then just try to dry run the code this makes even more clear with approach.

Beautiful Arrangements : To solve this problem, we can use the backtracking concept. If we find the valid element, the code will traverse to the next. If, not it will backtrack to another position. In this we can solve this problem.

In this way every problem has some logic try to find it and solve the problem. Some times we might not come up with the logic in that case we can find the approach and dry run the code.

I hope my experience will be helpful.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

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