Search
⌘ K
AI Features
Log In
CIP Part 2 C#
1.
Two Pointers
K-diff Pairs in an Array
Solution: K-diff Pairs in an Array
Longest Mountain in Array
Solution: Longest Mountain in Array
Meeting Scheduler
Solution: Meeting Scheduler
Maximize Greatness of an Array
Solution: Maximize Greatness of an Array
Find the Original Typed String I
Solution: Find the Original Typed String I
Remove Duplicates from Sorted List II
Solution: Remove Duplicates from Sorted List II
Count the Number of Fair Pairs
Solution: Count the Number of Fair Pairs
Sum of Square Numbers
Solution: Sum of Square Numbers
Find Beautiful Indices in the Given Array II
Solution: Find Beautiful Indices in the Given Array II
Number of Subsequences That Satisfy the Given Sum Condition
Solution: Number of Subsequences That Satisfy the Given Sum Condi
Zigzag Iterator
Solution: Zigzag Iterator
Length of Last Word
Solution: Length of Last Word
2.
Fast and Slow Pointers
3.
Sliding Window
Longest Substring with At Most K Distinct Characters
Solution: Longest Substring with At Most K Distinct Characters
Maximum Points You Can Obtain from Cards
Solution: Maximum Points You Can Obtain from Cards
Minimum Swaps to Group All 1's Together II
Solution: Minimum Swaps to Group All 1's Together II
Maximum Number of Occurrences of a Substring
Solution: Maximum Number of Occurrences of a Substring
Count Number of Nice Subarrays
Solution: Count Number of Nice Subarrays
Maximum Erasure Value
Solution: Maximum Erasure Value
Maximum Sum of Distinct Subarrays With Length K
Solution: Maximum Sum of Distinct Subarrays With Length K
Longest Nice Subarray
Solution: Longest Nice Subarray
Count Vowel Substrings of a String
Solution: Count Vowel Substrings of a String
Reschedule Meetings for Maximum Free Time I
Solution: Reschedule Meetings for Maximum Free Time I
Grumpy Bookstore Owner
Solution: Grumpy Bookstore Owner
Longest Strictly Increasing or Strictly Decreasing Subarray
Solution: Longest Strictly Increasing or Strictly Decreasing Suba
4.
Intervals
5.
In-Place Manipulation of a Linked List
6.
Heaps
Sort Characters By Frequency
Solution: Sort Characters By Frequency
Furthest Building You Can Reach
Solution: Furthest Building You Can Reach
Trapping Rain Water II
Solution: Trapping Rain Water II
Maximum Number of Events That Can Be Attended
Solution: Maximum Number of Events That Can Be Attended
Single-Threaded CPU
Solution: Single-Threaded CPU
Hand of Straights
Solution: Hand of Straights
Last Stone Weight
Solution: Last Stone Weight
7.
K-way merge
8.
Top K Elements
9.
Modified Binary Search
Search a 2D Matrix
Solution: Search a 2D Matrix
Find the Smallest Divisor Given a Threshold
Solution: Find the Smallest Divisor Given a Threshold
Zero Array Transformation II
Solution: Zero Array Transformation II
House Robber IV
Solution: House Robber IV
Minimum Number of Days to Make m Bouquets
Solution: Minimum Number of Days to Make m Bouquets
Valid Perfect Square
Solution: Valid Perfect Square
Peak Index in a Mountain Array
Solution: Peak Index in a Mountain Array
10.
Subsets
11.
Greedy Techniques
Minimum Adjacent Swaps to Make a Valid Array
Solution: Minimum Adjacent Swaps to Make a Valid Array
Special Binary String
Solution: Special Binary String
Maximize Distance to Closest Person
Solution: Maximize Distance to Closest Person
Minimum Number of Taps to Open to Water a Garden
Solution: Minimum Number of Taps to Open to Water a Garden
Valid Parenthesis String
Solution: Valid Parenthesis String
Minimum Number of Swaps to Make the String Balanced
Solution: Minimum Number of Swaps to Make the String Balanced
Minimum Number of Arrows to Burst Balloons
Solution: Minimum Number of Arrows to Burst Balloons
Minimum Increment to Make Array Unique
Solution: Minimum Increment to Make Array Unique
Zero Array Transformation III
Solution: Zero Array Transformation III
12.
Backtracking
Combination Sum II
Solution: Combination Sum II
13.
Dynamic Programming
Minimum Cost For Tickets
Solution: Minimum Cost For Tickets
Count Palindromic Subsequences
Solution: Count Palindromic Subsequences
Unique Paths II
Solution: Unique Paths II
Best Time to Buy and Sell Stock IV
Solution: Best Time to Buy and Sell Stock IV
Delete and Earn
Solution: Delete and Earn
Longest String Chain
Solution: Longest String Chain
Last Stone Weight II
Solution: Last Stone Weight II
Stickers to Spell Word
Solution: Stickers to Spell Word
New 21 Game
Solution: New 21 Game
Odd Even Jump
Solution: Odd Even Jump
2 Keys Keyboard
Solution: 2 Keys Keyboard
Minimum Cost to Cut a Stick
Solution: Minimum Cost to Cut a Stick
Domino and Tromino Tiling
Solution: Domino and Tromino Tiling
Maximum Number of Events That Can Be Attended II
Solution: Maximum Number of Events That Can Be Attended II
Scramble String
Solution: Scramble String
Minimum Falling Path Sum
Solution: Minimum Falling Path Sum
Find the Minimum Amount of Time to Brew Potions
Solution: Find the Minimum Amount of Time to Brew Potions
Target Sum
Solution: Target Sum
Maximum Sum Circular Subarray
Solution: Maximum Sum Circular Subarray
Coin Change II
Solution: Coin Change II
Maximum Sum of 3 Non-Overlapping Subarrays
Solution: Maximum Sum of 3 Non-Overlapping Subarrays
Ugly Number II
Solution: Ugly Number II
Longest Palindromic Subsequence
Solution: Longest Palindromic Subsequence
Different Ways to Add Parentheses
Solution: Different Ways to Add Parentheses
Best Time to Buy and Sell Stock with Transaction Fee
Solution: Best Time to Buy and Sell Stock with Transaction Fee
Minimum Operations to Reduce an Integer to 0
Solution: Minimum Operations to Reduce an Integer to 0
14.
Cyclic Sort
15.
Topological Sort
16.
Sort and Search
Minimum Absolute Difference
Solution: Minimum Absolute Difference
Most Profit Assigning Work
Solution: Most Profit Assigning Work
Rank Transform of an Array
Solution: Rank Transform of an Array
Relative Sort Array
Solution: Relative Sort Array
17.
Matrices
Search a 2D Matrix II
Solution: Search a 2D Matrix II
18.
Stacks
Next Greater Element II
Solution: Next Greater Element II
Sum of Subarray Minimums
Solution: Sum of Subarray Minimums
Car Fleet
Solution: Car Fleet
Clear Digits
Solution: Clear Digits
Remove All Occurrences of a Substring
Solution: Remove All Occurrences of a Substring
Subarray With Elements Greater Than Varying Threshold
Solution: Subarray With Elements Greater Than Varying Threshold
132 Pattern
Solution: 132 Pattern
Sum of Subarray Ranges
Solution: Sum of Subarray Ranges
Add Two Numbers II
Solution: Add Two Numbers II
Reverse Substrings Between Each Pair of Parentheses
Solution: Reverse Substrings Between Each Pair of Parentheses
Maximum Nesting Depth of the Parentheses
Solution: Maximum Nesting Depth of the Parentheses
Final Prices With a Special Discount in a Shop
Solution: Final Prices With a Special Discount in a Shop
Minimum Add to Make Parentheses Valid
Solution: Minimum Add to Make Parentheses Valid
19.
Graphs
Walls and Gates
Solution: Walls and Gates
Snakes and Ladders
Solution: Snakes and Ladders
The Maze
Solution: The Maze
Shortest Path in Binary Matrix
Solution: Shortest Path in Binary Matrix
All Nodes Distance K in Binary Tree
Solution: All Nodes Distance K in Binary Tree
Making A Large Island
Solution: Making A Large Island
Minimum Edge Reversals So Every Node Is Reachable
Solution: Minimum Edge Reversals So Every Node Is Reachable
Minimum Knight Moves
Solution: Minimum Knight Moves
Keys and Rooms
Solution: Keys and Rooms
Is Graph Bipartite?
Solution: Is Graph Bipartite?
Possible Bipartition
Solution: Possible Bipartition
Divide Nodes Into the Maximum Number of Groups
Solution: Divide Nodes Into the Maximum Number of Groups
Min Cost to Connect All Points
Solution: Min Cost to Connect All Points
20.
Tree Depth-First Search
Path Sum III
Solution: Path Sum III
Boundary of Binary Tree
Solution: Boundary of Binary Tree
Convert Sorted List to Binary Search Tree
Solution: Convert Sorted List to Binary Search Tree
Sum Root to Leaf Numbers
Solution: Sum Root to Leaf Numbers
Count Complete Tree Nodes
Solution: Count Complete Tree Nodes
Nested List Weight Sum
Solution: Nested List Weight Sum
Binary Tree Postorder Traversal
Solution: Binary Tree Postorder Traversal
21.
Tree Breadth-First Search
Binary Tree Vertical Order Traversal
Solution: Binary Tree Vertical Order Traversal
Maximum Width of Binary Tree
Solution: Maximum Width of Binary Tree
Cousins in Binary Tree
Solution: Cousins in Binary Tree
Cousins in Binary Tree
Solution: Cousins in Binary Tree
Minimum Depth of Binary Tree
Solution: Minimum Depth of Binary Tree
Populating Next Right Pointers in Each Node II
Solution: Populating Next Right Pointers in Each Node II
Find Largest Value in Each Tree Row
Solution: Find Largest Value in Each Tree Row
22.
Trie
23.
Hash Maps
Make Array Zero by Subtracting Equal Amounts
Solution: Make Array Zero by Subtracting Equal Amounts
Find Common Characters
Solution: Find Common Characters
Count Servers that Communicate
Solution: Count Servers that Communicate
Check If N and Its Double Exist
Solution: Check If N and Its Double Exist
Check If Array Pairs Are Divisible by k
Solution: Check If Array Pairs Are Divisible by k
Rabbits in Forest
Solution: Rabbits in Forest
Max Sum of a Pair With Equal Sum of Digits
Solution: Max Sum of a Pair With Equal Sum of Digits
Longest Harmonious Subsequence
Solution: Longest Harmonious Subsequence
Finding 3-Digit Even Numbers
Solution: Finding 3-Digit Even Numbers
Subarray Sums Divisible by K
Solution: Subarray Sums Divisible by K
Number of Black Blocks
Solution: Number of Black Blocks
Minimum Number of Steps to Make Two Strings Anagram
Solution: Minimum Number of Steps to Make Two Strings Anagram
Degree of an Array
Solution: Degree of an Array
Make Sum Divisible by P
Solution: Make Sum Divisible by P
Find the Prefix Common Array of Two Arrays
Solution: Find the Prefix Common Array of Two Arrays
Find Missing and Repeated Values
Solution: Find Missing and Repeated Values
Number of Divisible Triplet Sums
Solution: Number of Divisible Triplet Sums
Number of Matching Subsequences
Solution: Number of Matching Subsequences
24.
Knowing What to Track
Minimum Operations to Write the Letter Y on a Grid
Solution: Minimum Operations to Write the Letter Y on a Grid
Unique Length-3 Palindromic Subsequences
Solution: Unique Length-3 Palindromic Subsequences
Shortest Palindrome
Solution: Shortest Palindrome
Find the Celebrity
Solution: Find the Celebrity
Kids With the Greatest Number of Candies
Solution: Kids With the Greatest Number of Candies
Fruits Into Baskets II
Solution: Fruits Into Baskets II
Number of Good Pairs
Solution: Number of Good Pairs
Maximum Product of Three Numbers
Solution: Maximum Product of Three Numbers
Remove Outermost Parentheses
Solution: Remove Outermost Parentheses
Max Chunks To Make Sorted
Solution: Max Chunks To Make Sorted
Count Vowel Strings in Ranges
Solution: Count Vowel Strings in Ranges
Shortest Subarray with Sum at Least K
Solution: Shortest Subarray with Sum at Least K
Word Subsets
Solution: Word Subsets
Find the Highest Altitude
Solution: Find the Highest Altitude
Summary Ranges
Solution: Summary Ranges
Special Array I
Solution: Special Array I
Number of Ways to Split Array
Solution: Number of Ways to Split Array
String Compression III
Solution: String Compression III
Find Longest Special Substring That Occurs Thrice I
Solution: Find Longest Special Substring That Occurs Thrice I
Guess the Word
Solution: Guess the Word
Best Sightseeing Pair
Solution: Best Sightseeing Pair
Shortest Unsorted Continuous Subarray
Solution: Shortest Unsorted Continuous Subarray
Bitwise ORs of Subarrays
Solution: Bitwise ORs of Subarrays
Check if Array Is Sorted and Rotated
Solution: Check if Array Is Sorted and Rotated
Valid Word
Solution: Valid Word
Running Sum of 1d Array
Solution: Running Sum of 1d Array
Find Numbers with Even Number of Digits
Solution: Find Numbers with Even Number of Digits
Maximum Difference Between Increasing Elements
Solution: Maximum Difference Between Increasing Elements
25.
Union Find
Power Grid Maintenance
Solution: Power Grid Maintenance
Number of Operations to Make Network Connected
Solution: Number of Operations to Make Network Connected
26.
Custom Data Structures
27.
Bitwise Manipulation
Single Number III
Solution: Single Number III
Power of Four
Solution: Power of Four
28.
Math and Geometry
The kth Factor of n
Solution: The kth Factor of n
Find the Winner of the Circular Game
Solution: Find the Winner of the Circular Game
Build Array from Permutation
Solution: Build Array from Permutation
Minimum Moves to Equal Array Elements
Solution: Minimum Moves to Equal Array Elements
Angle Between Hands of a Clock
Solution: Angle Between Hands of a Clock
Type of Triangle
Solution: Type of Triangle
Convert Binary Number in a Linked List to Integer
Solution: Convert Binary Number in a Linked List to Integer
Count the Hidden Sequences
Solution: Count the Hidden Sequences
Find N Unique Integers Sum up to Zero
Solution: Find N Unique Integers Sum up to Zero
Excel Sheet Column Number
Solution: Excel Sheet Column Number
Water Bottles
Solution: Water Bottles
Excel Sheet Column Title
Solution: Excel Sheet Column Title
Ugly Number
Solution: Ugly Number
Reach a Number
Solution: Reach a Number
Claim your Certificate
Home
Courses
CIP Part 2 C#
Trapping Rain Water II
Try to solve the Trapping Rain Water II problem.
We'll cover the following...
Statement
Examples
Understand the problem
Figure it out!
Try it yourself
Statement
Given an
...