60 Days DSA Challenge
60 Days DSA Challenge
60 Days
DSA Challenge
by
You may assume that each input would have exactly one solution, and
Given a string s containing just the characters '(' , ')' , '{' , '}' ,
Every close bracket has a corresponding open bracket of the same type.
You are given the heads of two sorted linked lists list1 and list2 .
Merge the two lists in a one sorted list. The list should be made by splicing
You are given an array prices where prices[i] is the price of a given
You want to maximize your profit by choosing a single day to buy one
stock and choosing a different day in the future to sell that stock.
Return the maximum profit you can achieve from this transaction.
From To
Day 4
Invert Binary Tree Easy
Given the root of a binary tree, invert the tree, and return its root
different word or phrase, typically using all the original letters exactly once.
Practice Question asked in:
Day 6
Binary Search Easy
Given an array of integers nums which is sorted in ascending order, and
an integer target , write a function to search target in nums . If target
exists, then return its index. Otherwise, return -1 .
You must write an algorithm with 0(log n) runtime complexity.
You are also given three integers sr , sc and color . You should perform
D ay 8
Lowest Common Ancestor of a Binary
Given a binary search tree (BST), find the lowest common ancestor (LCA)
Day 10
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 list if there is some node in the list that can be
reached again by continuously following the next pointer . Internally, pos
is used to denote the index of the node that tail's next pointer is connected
to. Note that pos is not passed as a parameter.
Return true if there is a cycle in the linked list. Otherwise, return false .
Suppose you have n versions [1, 2, ..., n] and you want to find out
the first bad one, which causes all the following ones to be bad.
Day 12
Ransom Note Easy
From To
Gerald Amalraj
Fullstack Developer at JPMorgan Chase
Day 13
Each time you can either climb 1 or 2 steps. In how many distinct ways
Day 14
return the length of the longest palindrome that can be built with
those letters.
palindrome here.
Given two binary strings a and b return their sum as a binary string. s
Day 16
Given the root of a binary tree, return the length of the diameter of the tree.
The diameter of a binary tree is the length of the longest path between
any two nodes in a tree. This path may or may not pass through the root
From To
Akansha Likhdhari
Software Engineer III at Walmart
Day 17
Given the head of a singly linked list, return the middle node of the linked list.
If there are two middle nodes, return the second middle node.
Day 18
longest path from the root node down to the farthest leaf node.
Day 20
repeating characters.
Day 22
Binary Tree Level Order Traversal Medium
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 Question asked in:
From To
Anjali Joshi
Data Engineer - L2 at Twilio
Day 23
Clone Graph Medium
Day 24
Evaluate Reverse Polish Notation Medium
of the expression.
There are a total of numCourses courses you have to take, labeled from
0 to numCourses - 1 . You are given an array prerequisites where
prerequisites[i] = [ai, bi] indicates that you must take course
b i first if you want to take course a i .
Return true if you can finish all courses. Otherwise, return false .
Day 26
Implement Trie (Prefix Tree) Medium
Return the fewest number of coins that you need to make up that amount.
If that amount of money cannot be made up by any combination
of the coins, return -1
Day 28
Product of Array Except Self Medium
Given an integer array nums return an array answer such that answer[i]
is equal to the product of all the elements of nums except nums[i]
You must write an algorithm that runs in O(n) time and without using
the division operation.
Design a stack that supports push, pop, top, and retrieving the minimum
You must implement a solution with O(1) time complexity for each function.:
Day 30
lands horizontally or vertically. You may assume all four edges of the grid
Day 32
Rotting Oranges Medium
You are given an m x n grid where each cell can have one of
three values:
Return the minimum number of minutes that must elapse until no cell
has a fresh orange. If this is impossible, return -1
There is an integer array nums sorted in ascending order (with distinct values).
Given the array nums after the possible rotation and an integer target
return the index of target if it is in nums , or -1 is not in nums
Day 34
Combination Sum Medium
Permutations Medium
Given an array nums of distinct integers, return all the possible permutations.
You can return the answer in any order.
Day 36
From To
Subhadip Chowdhury
SWE at Target
Day 37
Given a binary tree, find the lowest common ancestor (LCA) of two given
Day 38
where the first element accounts[i][0] is a name, and the rest of the
After merging the accounts, return the accounts in the following format:
the first element of each account is the name, and the rest of the elements
in any order.
Day 40
Sort Colors Medium
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.
You must solve this problem without using the library's sort function.
Day 42
Spiral Matrix Medium
From To
Savita Ranganathan
Senior Software Engineer at Freshworks
Day 43
Subsets Medium
The solution set must not contain duplicate subsets. Return the
Day 44
the right side of it, return the values of the nodes you can see
ordered from top to bottom.
Day 46
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.
Day 48
Container With Most Water Medium
From To
Akansha Likhdhari
Software Engineer III at Walmart
Day 49
Given two strings s and p , return an array of all the start indices of
Day 50
an undirected edge between the two nodes in the tree, you can
choose any node of the tree as the root.
Return a list of all MHTs' root labels. You can return the answer in any order.
From To
Saumya Mishra
Sr. AEM Consultant at Adobe
Day 51
needs to do, where each letter represents a different task. Tasks could
be done in any order. Each task is done in one unit of time.
Return the least number of units of times that the CPU will take to finish
Day 52
LRUCache(int capacity) Initialize the LRU cache with positive size capacity
int get(int key) Return the value of the key if the key exists.
void put(int key, int value) Update the value of the key
th
the k smallest value (1-indexed) of all the values of the nodes in the tree.
Day 54
From To
Avishkar Dalvi
MTS 3 at VMware
Day 55
Find Median from Data Stream Hard
The median is the middle value in an ordered integer list. If the size
of the list is even, there is no middle value, and the median is the mean
Day 56
Word Ladder Hard
Day 58
Return the maximum profit you can take such that there are no two
From To
Merge all the linked-lists into one sorted linked-list and return it.
Day 60
height where the width of each bar is 1 , return the area of the largest
Upskilling with us
Join our Job-Oriented Programs
Explore more
www.tutort.net
Watch us on YouTube Read more on Quora
Follow us on
. . . . . .