Hello, Everyone! Today, I have solved three problems on LeetCode: Letter Combination of a Phone Number, Container with Most Water and Rotate Array. It seems that solving a different type of problem each day opens our eyes to view each problem from various aspects of thinking. One problem can have numerous solutions. Once we get one solution, there is no point to stop until we try to optimize its solution as well.
Letter Combination of a Phone Number: We may solve this problem by using backtracking with just one base condition. It needs finding all the possible character combinations that correspond to specific digits within the input provided. A base condition helps in making termination when needed in the execution of the function. This makes the solution effective.
Container holding Maximum Water: Here we find the maximum area possible. We are traversing the array using two pointers one starting from the beginning and the other from the last of the array. It is going to give the solution with a very efficient approach.
Rotate Array: This is one problem in the number of positions where you should rotate the array. The problem is possible with a slicing an array at specified position and you should make the new array attaching slices in the proper order. This type of approach towards the problem solution will be helpful to get the problem's solution.
I hope my experience will be helpful to you.
Top comments (0)