Zero To Hero in DSA
Zero To Hero in DSA
Zero To Hero in DSA
Practice
01
Day 4 Pascal's Triangle
Given an integer numRows, return the first numRows of
Pascal's triangle.
Practice
Practice
02
Day 7 Reverse Words in a String
Given an input string s, reverse the order of the words.
Practice
Practice
Practice
03
Day 10 Valid Anagram
Given two strings s and t, return true if t is an anagram of
s, and false otherwise.
Practice
Practice
04
Day 13 Subsets II
Given an integer array nums that may contain duplicates,
return all possible subsets (the power set).
Practice
Practice
05
Day 16 Power of Two
Given an integer n, return true if it is a power of two.
Otherwise, return false.
Practice
Practice
Practice
06
Day 19 Reverse Linked List
Given the head of a singly linked list, reverse the list, and
return the reversed list.
Practice
Practice
Merge the two lists in a one sorted list. The list should be
made by splicing together the nodes of the first two lists.
Practice
07
Day 22 Add Two Numbers
You are given two non-empty linked lists representing
two non-negative integers. The digits are stored in
reverse order, and each of their nodes contains a single
digit. Add the two numbers and return the sum as a linked
list.
Practice
Practice
08
Day 25 Single Element in a Sorted Array
You are given a sorted array consisting of only integers
where every element appears exactly twice, except for
one element which appears exactly once.
Practice
Practice
09
Day 28 Kth Largest Element in an Array
Given an integer array nums and an integer k, return the
kth largest element in the array.
Practice
Practice
Practice
10
Day 31 Implement Stack using Queues
Implement a last-in-first-out (LIFO) stack using only two
queues. The implemented stack should support all the
functions of a normal stack (push, top, pop, and empty).
Practice
Practice
Practice
11
Day 34 LRU Cache
Design a data structure that follows the constraints of a
Least Recently Used (LRU) cache.
Practice
Practice
Practice
12
Day 37 Sliding Window Maximum
You are given an array of integers nums, there is a sliding
window of size k which is moving from the very left of the
array to the very right. You can only see the k numbers in
the window. Each time the sliding window moves right by
one position.
Practice
Practice
13
Day 40 Binary Tree Inorder Traversal
Practice
Practice
Practice
Practice
14
Day 43 Binary Tree Level Order Traversal
Given the root of a binary tree, return the level order
traversal of its nodes' values. (i.e., from left to right, level
by level).
Practice
Practice
Practice
15
Day 46 Vertical Order Traversal of a Binary Tree
Given the root of a binary tree, calculate the vertical
order traversal of the binary tree.
Practice
Practice
Practice
16
Day 49 Binary Tree Zigzag Level Order Traversal
Given the root of a binary tree, return the zigzag level
order traversal of its nodes' values. (i.e., from left to right,
then right to left for the next level and alternate
between).
Practice
Practice
Practice
17
Day 52 Course Schedule
There are a total of numCourses courses you have to
take, labeled from 0 to numCourses - 1. You are given an
array prerequisites.
Practice
Practice
Practice
18
Day 55 Kosaraju algorithm O(N)
Model this question as graph problem.
Practice
You are given the source vertex S and You to Find the
shortest distance of all the vertex's from the source vertex
S. You have to return a list of integers denoting shortest
distance between each node and Source vertex S.
Practice
19
Day 57 Bellman-Ford Algorithm
Given a weighted, directed and connected graph of V
vertices and E edges, Find the shortest distance of all the
vertex's from the source vertex S.
Practice
Practice
Practice
20
Day 60 Maximum Product Subarray
Given an integer array nums, find a subarray that has the
largest product, and return the product.
The test cases are generated so that the answer will fit in
a 32-bit integer.
Practice
Practice
Practice
21
Day 63 Edit Distance
Given two strings word1 and word2, return the minimum
number of operations required to convert word1 to word2.
Practice
22
Day 65 Minimum Path Sum
Given a m x n grid filled with non-negative numbers, find a
path from top left to bottom right, which minimizes the
sum of all numbers along its path.
Practice
Practice
23
Day 67 Partition Equal Subset Sum
Given an integer array nums, return true if you can partition
the array into two subsets such that the sum of the
elements in both subsets is equal or false otherwise.
Practice
Practice
Practice
24
Day 70 Word Break
Given a string s and a dictionary of strings wordDict, return
true if s can be segmented into a space-separated
sequence of one or more dictionary words.
Practice
Practice
Practice
25
Day 70 Word Break
Given a string s and a dictionary of strings wordDict, return
true if s can be segmented into a space-separated
sequence of one or more dictionary words.
Practice
Practice
Practice
26
Day 73 Power Set
Given a string S, Find all the possible subsequences of the
String in lexicographically-sorted order.
Practice
Practice
Practice
27
07
+91-7260058093 www.algotutor.io info@algotutor.io