DEV Community

Rishitha Nallapureddy
Rishitha Nallapureddy

Posted on

Journal - 11-11-24

Hi, folks! Today, I solved three problems on LeetCode: Maximum Value at a Given Index in a Bounded Array, Maximum Length of Pair Chain, and Push Dominoes. This week, along with revision, I added some new problems to my plan. Planning the entire week on Monday really helps a lot. There’s no need to think every day about what to practice! We gain clarity on our plan and can schedule all other daily tasks accordingly.

To solve Maximum Value at a Given Index in a Bounded Array, we are asked to construct an array where the sum of the elements is less than or equal to the target sum provided in the input, and the length of the created array should be equal to the target length. We can use the two-pointers technique to manage the left and right sides, keeping track of the sum for both sides. This approach allows us to solve the problem efficiently.

To solve Maximum Length of Pair Chain, we need to check if each chain follows specific constraints. If a chain satisfies these constraints, we include it in the count. otherwise, we skip it. We can sort all the chains, iterate through them, check the constraints, and increment the count accordingly before returning the result. This method helps solve the problem effectively.

I hope my experience will be helpful!

Top comments (0)