Two Pointers Technique in Java — A Practical Guide for Serious Engineers
Two Pointers is one of the most effective techniques for turning brute-force array/string solutions into linear-time solutions.
Two Pointers is one of the most effective techniques for turning brute-force array/string solutions into linear-time solutions.
This guide explains the intuition, optimized approach, and Java implementation for sort array by parity in java, with practical tips for interviews and produ...
This guide explains the intuition, optimized approach, and Java implementation for maximum subarray in java (kadane algorithm), with practical tips for inter...
Given a string containing only ()[]{}, return true if brackets are valid. A valid string must close in correct order and with correct bracket type.
Given an array nums of size n where values are in range [1, n], some numbers appear twice and others are missing. Return all missing numbers.
This guide explains the intuition, optimized approach, and Java implementation for move zeroes in java (stable in-place), with practical tips for interviews ...
Given an integer array where every value appears exactly twice except one value, return the value that appears once.
This guide explains the intuition, optimized approach, and Java implementation for maximum depth of binary tree in java, with practical tips for interviews a...
This guide explains the intuition, optimized approach, and Java implementation for remove duplicates from sorted list ii in java, with practical tips for int...
Given a sorted array, remove duplicates in-place so each unique value appears once. Return the number of unique elements.
Given a string, repeatedly remove adjacent equal characters until no such pair remains.
This guide explains the intuition, optimized approach, and Java implementation for palindrome number in java (without string conversion), with practical tips...
Given the head of a singly linked list, return its middle node. If the list has two middle nodes, return the second middle.
This guide explains the intuition, optimized approach, and Java implementation for longest substring without repeating characters in java, with practical tip...
This guide explains the intuition, optimized approach, and Java implementation for linked list cycle ii in java (find cycle start), with practical tips for i...
This guide explains the intuition, optimized approach, and Java implementation for first missing positive in java, with practical tips for interviews and pro...
This guide explains the intuition, optimized approach, and Java implementation for find first and last position of element in sorted array, with practical ti...
Given a rotated sorted array with distinct values, find the minimum element in O(log n).
This guide explains the intuition, optimized approach, and Java implementation for remove linked list elements in java, with practical tips for interviews an...
Given a sorted linked list, remove duplicate nodes so each value appears exactly once.
Given an array height, pick two indices i and j to form a container. Maximize area:
This guide explains the intuition, optimized approach, and Java implementation for binary search in java (iterative and recursive), with practical tips for i...
This guide explains the intuition, optimized approach, and Java implementation for add two numbers represented as linked list, with practical tips for interv...
This guide explains the intuition, optimized approach, and Java implementation for detect a loop in linked list (floyd cycle detection), with practical tips ...
Reverse a singly linked list using recursion.
This guide explains the intuition, optimized approach, and Java implementation for reverse linked list iteratively in java, with practical tips for interview...