# Two Pointers

## Remove Duplicates from Sorted Array LeetCode Solution

Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same.

Leetcode Solution

## Longest Substring Without Repeating Characters LeetCode Solution

Given a string s, find the length of the longest substring without repeating characters.

Leetcode Solution

## 3Sum LeetCode Solution

Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.

Leetcode Solution

## Remove Element LeetCode Solution

Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The relative order of the elements may be changed.

Leetcode Solution

## Find the Index of the First Occurrence in a String LeetCode Solution

Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.

Leetcode Solution

## Next Permutation LeetCode Solution

Given an array of integers nums, find the next permutation of nums.

Leetcode Solution

## Trapping Rain Water LeetCode Solution

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.

Leetcode Solution
Scroll to Top