Srisrip.hashnode.dev·11 hours agoExploring Advanced Array Techniques: Beyond the BasicsAre you ready to dive into the world of efficient array manipulation? Today, let's talk about the Two Pointer Approach - a powerful technique used to solve various array problems. Before Deep Dive into Advance: Let's once again dig into basic program...Discusstwo pointers
Tuseef ashraftossef.hashnode.dev·Apr 20, 2024Two Pointers patternIn the world of algorithms and data structures, efficient solutions often rely on clever techniques to manipulate data. One such technique, the "two pointers" approach, is particularly useful for solving a variety of problems. While traditionally ass...Discusstwo pointers
Akshay Pariharakshayparihar.hashnode.dev·Mar 30, 202420 Coding Patters to Ace coding InterviewsTwo Pointers It is used when we need to find pairs or sub-arrays in an array that satisfy a certain condition, or when we need to find a specific element in a sorted array. Typically, the two pointers advance towards opposite ends of the data structu...Discussdata structure and algorithms
Arpit Rathorearpitrathore.com·Feb 12, 2024Longest Substring Without Repeating Characters3. Longest Substring Without Repeating Characters Given a string s, find the length of the longest substring without repeating characters. Example 1: Input: s = "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3. Example ...DiscussTop interview questions two pointers
Gulshan Kumarperfinsights.hashnode.dev·Feb 1, 2024Reverse Words in a String IIIGiven a string s, reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. LeetCode Problem - 557: Link | Click Here class Solution { public String reverseWords(String s) { /...DiscussJava SolutionJava
Gulshan Kumarperfinsights.hashnode.dev·Jan 20, 2024Reverse Words in a StringGiven an input string s, reverse the order of the words. A word is defined as a sequence of non-space characters. The words in s will be separated by at least one space. Return a string of the words in reverse order concatenated by a single space. No...DiscussJava SolutionJava
Gulshan Kumarperfinsights.hashnode.dev·Jan 20, 2024Move ZeroesGiven an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. LeetCode Problem - 283: Link | Click Here class Solution...DiscussJava Solutionarray
Evelyn Liuevelynsjourney.hashnode.dev·Jan 11, 2024Day 4 of LeetCodeDocumenting LeetCode solving. Q1 125. Valid Palindrome Easy. Two pointers. class Solution: def isPalindrome(self, s: str) -> bool: # Extra space newStr = "" for c in s: # isalpha() is to check if the character...Discuss·26 reads30+20 days of LeetCode leetcode
Suryasuryasun.hashnode.dev·Jan 3, 2024Two Sum II - Input Array Is Sorted Using Two Pointersvar twoSum = function (numbers, target) { let [start, end] = [0, numbers.length - 1]; while (start < end) { const currentSum = numbers[start] + numbers[end]; const isTarget = currentSum === target; if (isTarget) { ...Discuss·10 likes·30 readsDSA in JStwo pointers
ROSHAN CSE0026roshanjha23.hashnode.dev·Nov 18, 2023Solving the “Remove Element” Problem in JavaIntroduction When it comes to solving array manipulation problems, the Two Pointers technique is a handy approach. In this blog post, we’ll explore how to apply this technique to solve the “Remove Element” problem in Java. This problem asks us to rem...DiscussJava