Kanchan RaiforKanchan Raikanchanraiii.hashnode.dev·a day agoDay 3 : 100 Days Of DSAHey there, welcome to the day 3 of 100 days of DSA challenge. Today, I’ll be solving some advanced array problems. Here's a quick look at the questions I tackled and how I approached them 🤖✨ Check out my GitHub repository for all my solutions and pr...Discuss·1 like100 Days of DSAtwo pointers
Tapan Rachchhtapanrachchh.hashnode.dev·Oct 26, 202411. Container With Most Waterclass Solution: def maxArea(self, height: List[int]) -> int: x = 0 l = len(height) y = l - 1 maxWater = 0 for gap in range(l - 1, 0, -1): xVal = height[x] yVal = height[y] ...DiscussPython
Enoch OlutunmidaProwww.thatsametechguy.com·Oct 26, 2024Deleting the Middle Node of a Linked List Using the Tortoise and Hare Algorithm in TypeScriptIntroduction In this post, we’ll be solving LeetCode Problem 2095: “Delete the Middle Node of a Linked List.” The problem statement on LeetCode is: You are given the head of a linked list. Delete the middle node and return the head of the modified l...Discuss·1 like·33 readsleetcode
Ashikur Rahmanashikonweb.hashnode.dev·Oct 10, 2024Understanding the Two-Pointer TheoryThe two-pointer theory is a technique commonly used to solve array or linked list problems in a more efficient manner. Instead of using nested loops, which can increase the time complexity of a problem, two-pointer theory allows us to traverse the da...Discuss·1 likeTutorial
Nguyen Van Tuantuannguyenhust.hashnode.dev·Oct 10, 2024Two pointer with GolangWrite a function that reverses a string. The input string is given as an array of characters s. You must do this by modifying the input array in-place with O(1) extra memory. Example 1: Input: s = ["h","e","l","l","o"] Output: ["o","l","l","e","h"] ...DiscussBasic algorithmstwo pointers
yuvan bajjurlaalgoinsights.hashnode.dev·Sep 29, 2024Reverse Vowels of a StringHii Viewers, Welcome to my DSA blog let’s dive through the problem of Reversing Vowels of a String. Problem statement Given a string s, reverse only all the vowels in the string and return it. The vowels are 'a', 'e', 'i', 'o', and 'u', and they can ...DiscussDSA
SANTOSH SINGHsantoshsingh.hashnode.dev·Sep 1, 2024Mastering the Two-Pointer Technique in Java: A Detailed GuideWhat is the Two-Pointer Technique? The two-pointer technique is a pattern often used in scenarios where you need to search for pairs in a sequence or compare elements in a sorted array or list. As the name suggests, it involves using two pointers, ty...DiscussProblem Solvers' Journalthreesum
ddhuuddhuu.hashnode.dev·Jul 19, 2024Mastering the Two Pointers TechniqueIntroduction The Two Pointers technique is a versatile and efficient method commonly used to solve various problems involving arrays, strings, and linked lists. This technique is particularly effective when dealing with pairs or sub-arrays that need ...Discuss·2 likesDSA
Jay Choukseyjayjava.hashnode.dev·Jul 15, 2024Max Number of K-Sum PairsIntroduction Today, I tackled another intriguing problem from LeetCode 75: Max Number of K-Sum Pairs. This medium-level question requires an understanding of arrays and the two-pointer technique. The goal is to find the maximum number of operations y...DiscussJava
Jay Choukseyjayjava.hashnode.dev·Jul 14, 2024Container With Most WaterIntroduction Today, I tackled an interesting problem from LeetCode 75: Container With Most Water. This medium-level question requires knowledge of two pointers and greedy algorithms. It involves finding the maximum amount of water a container can sto...DiscussJava