Zero To Advance in DSA: 50 Days Challenge
Zero To Advance in DSA: 50 Days Challenge
in DSA
50 Days Challenge
*Disclaimer*
Everyone learns uniquely.
1
Day 1 #Arrays
Given an array of integers and an integer target, return indices of the two
numbers such that they add up to target.
Practice
Practice
Day 2 #Arrays
Given an integer array nums, find the subarray with the largest sum, and
return its sum.
Practice
Practice
Day 3 #Arrays
Given an array nums with n objects colored red, white, or blue, sort them in-
place so that objects of the same color are adjacent, with the colors in the
order red, white, and blue.
Practice
Practice
2
Day 4 #Arrays
Given an array nums of n integers, return an array of all the unique
quadruplets [nums[a], nums[b], nums[c], nums[d]] such that:
0 <= a, b, c, d < n
Day 5 #Arrays
Given an array of intervals where intervals[i] = [starti, endi], merge all
overlapping intervals, and return an array of the non-overlapping intervals
that cover all the intervals in the input.
Practice
Practice
Day 6 #Strings
Given a string s of '(' , ')' and lowercase English characters.
Your task is to remove the minimum number of parentheses ( '(' or ')', in any
positions ) so that the resulting parentheses string is valid and return any valid
string.
Practice
Practice
3
Day 7 #Strings
Given a string s, sort it in decreasing order based on the frequency of the
characters. The frequency of a character is the number of times it appears in
the string.
Return the sorted string. If there are multiple answers, return any of them.
Practice
Practice
Day 8 #Strings
Given two strings s1 and s2, return true if s2 contains a permutation of s1, or
false otherwise.
In other words, return true if one of s1's permutations is the substring of s2.
Practice
Practice
Day 9 #Strings
Given a string s, partition s such that every
Practice
Practice
4
Day 10 #Strings
Given two strings s and t of lengths m and n respectively, return the minimum
window
Practice
Practice
Day 11 #Recursion
Given the head of a linked list and an integer val, remove all the nodes of the
linked list that has Node.val == val, and return the new head.
Practice
Practice
Day 12 #Recursion
Given the head of a singly linked list, reverse the list, and return the reversed
list.
Practice
Practice
5
Day 13 #Recursion
Given an integer array nums of unique elements, return all possible
The solution set must not contain duplicate subsets. Return the solution in
any order
Practice
Practice
Day 14 #Recursion
Given n pairs of parentheses, write a function to generate all combinations of
well-formed parentheses.
Practice
Practice
Day 15 #Hashing
Design a data structure that follows the constraints of a Least Recently Used
(LRU) cache.
Practice
Practice
6
Day 16 #Hashing
Given an unsorted integer array nums, return the smallest missing positive
integer.
You must implement an algorithm that runs in O(n) time and uses constant
extra space.
Practice
Practice
Day 17 #Matrices
Given an m x n matrix, return all elements of the matrix in spiral order.
Practice
Practice
Day 18 #Matrices
Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be
validated according to the following rules:
Each of the nine 3 x 3 sub-boxes of the grid must contain the digits 1-9
without repetition.
Practice
Practice
7
Day 19 #Matrices
Given an m x n grid of characters board and a string word, return true if word
exists in the grid.
Practice
Practice
The "linked list" should use the same TreeNode class where the right child
pointer points to the next node in the list and the left child pointer is always
null.
The "linked list" should be in the same order as a pre-order traversal of the
binary tree.
Practice
Practice
8
Day 21 #Linked List
Given the head of a singly linked list, return true if it is a palindrome or false
otherwise.
Practice
Practice
You may not alter the values in the list's nodes, only nodes themselves may be
changed.
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
Practice
9
Day 24 #Linked List
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.
You may assume the two numbers do not contain any leading zero, except the
number 0 itself.
Practice
Practice
Practice
Practice
10
Day 26 #Bit Manipulation and Math
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.
You may assume the two numbers do not contain any leading zero, except the
number 0 itself.
Practice
Practice
Given a linked list, swap every two adjacent nodes and return its head. You
must solve the problem without modifying the values in the list's nodes (i.e.,
only nodes themselves may be changed.)
Practice
Practice
Practice
Practice
11
Day 29 #Stacks and Queues
Design a stack that supports push, pop, top, and retrieving the minimum
element in constant time.
Practice
Practice
Practice
Practice
Practice
Practice
12
Day 32 #Stacks and Queues
Given n non-negative integers representing an elevation map where the width
of each bar is 1, compute how much water it can trap after raining.
Practice
Practice
A binary tree's maximum depth is the number of nodes along the longest path
from the root node down to the farthest leaf node.
Practice
Practice
Practice
Practice
13
Day 35 #Trees and Binary Search Trees
Given the root of a binary search tree, and an integer k, return the kth
smallest value (1-indexed) of all the values of the nodes in the tree.
Practice
Practice
Practice
Practice
For example, the root-to-leaf path 1 -> 2 -> 3 represents the number 123.Return
the total sum of all root-to-leaf numbers. Test cases are generated so that the
answer will fit in a 32-bit integer.
Practice
Practice
14
Day 38 #Trees and Binary Search Trees
Given the roots of two binary trees root and subRoot, return true if there is a
subtree of root with the same structure and node values of subRoot and false
otherwise.
Practice
Practice
Day 39 #Tries
A trie (pronounced as "try") or prefix tree is a tree data structure used to
efficiently store and retrieve keys in a dataset of strings. There are various
applications of this data structure, such as autocomplete and spellchecker.
Practice
Practice
Day 40 #Tries
Given an array of strings strs, group the anagrams together. You can return
the answer in any order.
Practice
Practice
15
Day 41 #Heaps
Given the roots of two binary trees root and subRoot, return true if there is a
subtree of root with the same structure and node values of subRoot and false
otherwise.
Practice
Practice
Day 42 #Heaps
A trie (pronounced as "try") or prefix tree is a tree data structure used to
efficiently store and retrieve keys in a dataset of strings. There are various
applications of this data structure, such as autocomplete and spellchecker.
Practice
Practice
Day 43 #Graphs
Given is a 2D adjacency list representation of a graph. Check whether the
graph is a Bipartite graph.
Practice
Practice
16
Day 44 #Graphs
An image is represented by an m x n integer grid image where image[i][j]
represents the pixel value of the image.
You are also given three integers sr, sc, and color. You should perform a flood
fill on the image starting from the pixel image[sr][sc].
Practice
Practice
Day 45 #Graphs
Given an m x n 2D binary grid grid which represents a map of '1's (land) and
'0's (water), return the number of islands.
Practice
Practice
Day 46 #Graphs
Given a reference of a node in a connected undirected graph.
Practice
Practice
17
Day 47 #Graphs
Given an m x n integers matrix, return the length of the longest increasing
path in matrix.
From each cell, you can either move in four directions: left, right, up, or down.
You may not move diagonally or move outside the boundary (i.e., wrap-around
is not allowed).
Practice
Practice
Practice
Practice
Practice
Practice
18
Day 50 #Dynamic Programming
There is a robot on an m x n grid. The robot is initially located at the top-left
corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner
(i.e., grid[m - 1][n - 1]). The robot can only move either down or right at any
point in time.
Given the two integers m and n, return the number of possible unique paths
that the robot can take to reach the bottom-right corner.
Practice
Practice
19
Why
Bosscoder?
1000+ Alumni placed at Top
Product-based companies.
Explore More