Easy
Problem |
Pattern |
Lists |
Description |
|---|---|---|---|
Math, String, Bit Manipulation, Simulation |
Grind 75, Grind 169 |
Given two binary strings a and b, return their sum as a binary string |
|
Tree, Depth-First Search, Binary Tree |
Grind 75, Grind 169, NeetCode 150 |
Given a binary tree, determine if it is height-balanced |
|
Array, Dynamic Programming |
Blind 75, Grind 75, Grind 169, NeetCode 150, Google Top 50 |
You are given an array prices where prices[i] is the price of a given stock on the i :sup:th day. You want to |
|
Array, Binary Search |
Grind 75, Grind 169, NeetCode 150 |
Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search |
|
Stack, Tree, Depth-First Search, Binary Tree |
Given the root of a binary tree, return the inorder traversal of its nodes’ values |
||
Math, Dynamic Programming, Memoization |
Blind 75, Grind 75, Grind 169, NeetCode 150 |
You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how |
|
Array, Hash Table, Sorting |
Blind 75, Grind 75, Grind 169, NeetCode 150 |
Given an integer array nums, return true if any value appears at least twice in the array, and return false if every |
|
Array, Hash Table, Sliding Window |
Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such |
||
Array, Divide and Conquer, Tree, Binary Search Tree, Binary Tree |
Grind 169 |
Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binary |
|
Tree, Depth-First Search, Binary Tree |
Grind 75, Grind 169, NeetCode 150 |
Given the root of a binary tree, return the length of the diameter of the tree. The diameter of a binary tree is the |
|
Two Pointers, String, String Matching |
Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle |
||
Hash Table, String, Queue, Counting |
Given a string s, find the first non-repeating character in it and return its index. If it does not exist, return -1 |
||
Math, String, Simulation |
Given an integer n, return a string array answer ( 1-indexed ) where: - answer[i] == “FizzBuzz” if i is divisible by |
||
Hash Table, Math, Two Pointers |
NeetCode 150, Google Top 50 |
Write an algorithm to determine if a number n is happy. A happy number is a number defined by the following process: - |
|
Array, Hash Table, Two Pointers, Binary Search, Sorting |
Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must |
||
Hash Table, Linked List, Two Pointers |
Given the heads of two singly linked-lists headA and headB, return the node at which the two lists intersect. If the |
||
Tree, Depth-First Search, Breadth-First Search, Binary Tree |
Blind 75, Grind 75, Grind 169, NeetCode 150 |
Given the root of a binary tree, invert the tree, and return its root |
|
Two Pointers, String, Dynamic Programming |
Given two strings s and t, return true if s is a subsequence of t , or false otherwise. A subsequence of a string is a |
||
Hash Table, String |
Given two strings s and t, determine if they are isomorphic. Two strings s and t are isomorphic if the characters in s |
||
Tree, Design, Binary Search Tree, Heap (Priority Queue), Binary Tree, Data Stream |
NeetCode 150 |
You are part of a university admissions office and need to keep track of the kth highest test score from applicants in |
|
Array, Heap (Priority Queue) |
NeetCode 150 |
You are given an array of integers stones where stones[i] is the weight of the i :sup:th stone. We are playing a |
|
String |
Given a string s consisting of words and spaces, return the length of the last word in the string. A word is a |
||
Hash Table, Linked List, Two Pointers |
Blind 75, Grind 75, Grind 169, NeetCode 150 |
Given head, the head of a linked list, determine if the linked list has a cycle in it. There is a cycle in a linked |
|
Array, String, Trie |
Grind 169, Google Top 50 |
Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, |
|
Array, Hash Table, Divide and Conquer, Sorting, Counting |
Grind 75, Grind 169 |
Given an array nums of size n, return the majority element. The majority element is the element that appears more than |
|
Tree, Depth-First Search, Breadth-First Search, Binary Tree |
Blind 75, Grind 75, Grind 169, NeetCode 150 |
Given the root of a binary tree, return its maximum depth. A binary tree’s maximum depth is the number of nodes along |
|
Array, Two Pointers, Sorting |
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, |
||
Linked List, Recursion |
Blind 75, Grind 75, Grind 169, NeetCode 150 |
You are given the heads of two sorted linked lists list1 and list2. Merge the two lists into one sorted list. The list |
|
Array, Dynamic Programming |
NeetCode 150 |
You are given an integer array cost where cost[i] is the cost of i :sup:th step on a staircase. Once you pay the |
|
Array, Hash Table, Math, Binary Search, Bit Manipulation, Sorting |
Blind 75, Grind 169, NeetCode 150 |
Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is |
|
Linked List, Two Pointers, Stack, Recursion |
Grind 169 |
Given the head of a singly linked list, return true if it is a palindrome or false otherwise |
|
Math |
Grind 169, Google Top 50 |
Given an integer x, return true if x is a palindrome , and false otherwise |
|
Array, Dynamic Programming |
Given an integer numRows, return the first numRows of Pascal’s triangle. In Pascal’s triangle, each number is the |
||
Array, Math |
NeetCode 150 |
You are given a large integer represented as an integer array digits, where each digits[i] is the i :sup:th digit of |
|
Math, Recursion |
Given an integer n, return true if it is a power of three. Otherwise, return false. An integer n is a power of three, |
||
Hash Table, String, Counting |
Grind 75, Grind 169 |
Given two strings ransomNote and magazine, return true if ransomNote can be constructed by using the letters from |
|
Array, Two Pointers |
Given an integer array nums and an integer val, remove all occurrences of val in nums in-place |
||
Linked List, Recursion |
Blind 75, Grind 75, Grind 169, NeetCode 150 |
Given the head of a singly linked list, reverse the list, and return the reversed list |
|
Two Pointers, String |
Write a function that reverses a string. The input string is given as an array of characters s. You must do this by |
||
Hash Table, Math, String |
Grind 169, Google Top 50 |
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. :: Symbol Value I |
|
Tree, Depth-First Search, Breadth-First Search, Binary Tree |
Blind 75, Grind 169, NeetCode 150 |
Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees |
|
Math, Binary Search |
Given a non-negative integer x, return the square root of x rounded down to the nearest integer. The returned integer |
||
Tree, Depth-First Search, String Matching, Binary Tree, Hash Function |
Blind 75, Grind 169, NeetCode 150 |
Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure |
|
Array |
You are given a sorted unique integer array nums. A range [a,b] is the set of all integers from a to b (inclusive) |
||
Tree, Depth-First Search, Breadth-First Search, Binary Tree |
Grind 169 |
Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center) |
|
Array, Hash Table |
Blind 75, Grind 75, Grind 169, NeetCode 150, Google Top 50 |
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to |
|
Hash Table, String, Sorting |
Blind 75, Grind 75, Grind 169, NeetCode 150 |
Given two strings s and t, return true if t is an anagram of s, and false otherwise |
|
Two Pointers, String |
Blind 75, Grind 75, Grind 169, NeetCode 150 |
A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all |
|
String, Stack |
Blind 75, Grind 75, Grind 169, NeetCode 150 |
Given a string s containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is |
|
Hash Table, String |
Given a pattern and a string s, find if s follows the same pattern. Here follow means a full match, such that there is |