Two pointers

Mar
07
2024
0

Daily Question – 0876. Middle of the Linked List

Implement a ‘two pointers’ algorithm, where one pointer moves at a fast pace, advancing two steps at a time, and the other moves at a slower pace, advancing one step at a time. When the fast pointer reaches the end, return the position of the slow pointer.

Mar
06
2024
0

Daily Question – 0141. Linked List Cycle

This problem also employs the “Two Pointers” technique, which is rather ingenious.

Mar
05
2024
0
Mar
04
2024
0
Feb
15
2024
0

18. 4Sum

Same as 3sum, for big number, using BigInteger .

Feb
14
2024
0
Feb
14
2024
0

*15. 3Sum

Sort the array, then use 2 pointers to get the exceeded result.

Feb
12
2024
0

11. Container With Most Water

Description: https://leetcode.com/problems/container-with-most-water/ Notes: Using two pointers