ProDeveloperTutorialonAugust 31, 2026 Two Pointers: Given a binary string, check if the string has most number of contiguous segment of one Problem Statement: Given a binary string, check if the string has most number of contiguous segment of one Example: Input: arr =…
ProDeveloperTutorialonAugust 31, 2026 Two Pointers: Given a string, reverse the string by preserving whitespace. Problem Statement: You are given a string, reverse the string by preserving whitespace. Example: Input: s = Hi world Output: dl rowih Solution…
ProDeveloperTutorialonAugust 31, 2026 Two Pointers: Given a binary array, return maximum consecutive ones Problem Statement: You are given a binary array, you need to return the maximum number of consecutive 1s in the array Example: Input: arr =…
ProDeveloperTutorialonAugust 31, 2026 Two Pointers: Given 2 arrays, find the common elements Problem Statement: You are given 2 arrays. You need to return the common elements between the 2 arrays Example: Input: a = [1, 2, 3, 4] b =…
ProDeveloperTutorialonAugust 31, 2026 Two Pointers: Given an array, sort the array by making element squares Problem Statement: You are given an array of both positive and negative integers. You need to sort the array by making the square of the…
ProDeveloperTutorialonAugust 31, 2026 Two Pointers: Minimum boats to save people Problem Statement: You are given a people array that will have weight of ith person. You are given infinite boats,but each boat can carry…
ProDeveloperTutorialonAugust 31, 2026 Two Pointers: Given a string with special characters, reverse only alphabets Problem Statement: Given a string with special characters, reverse only alphabets Example: Input: str = ab$cd Output: str = dc$ba Solution…
ProDeveloperTutorialonAugust 31, 2026 Two Pointers: Meeting rooms Problem Statement: You are given 2 arrays start[] and end[]. Start[i] gives the start of the meeting and end[i] gives the end of the meeting.…
ProDeveloperTutorialonAugust 31, 2026 Two Pointers: Count pairs with sum less than target Problem Statement: You are given an array and an target. You need to find the count of pairs whose sum is strictly less than given target…
ProDeveloperTutorialonAugust 31, 2026 Two Pointers : Move all negative numbers to beginning and positive to end using extra space Problem Statement: You are given an array with +ve and -ve numbers in random order. You need to re arrange the elements that all -ve elements…