Reference Links :
https://www.geeksforgeeks.org/computer-network-tutorials/Reference Links :
https://youtu.be/wN0x9eZLix4Reference Links :
https://www.geeksforgeeks.org/operating-systems/Reference Links :
https://www.geeksforgeeks.org/linux-commands/
1. whoami
-- returns the UserName
2. man
-- manual, man whoami = gives the description of whoami
3. clear
-- clear terminal, clear -x scrolls down
4. pwd
-- displays present working directory
5. ls
-- displays list of files in that folder
6. cd
-- change directory, cd /Desktop/aoight, cd ../.. , cd ~/
7. mkdir
-- make directory, creates folder, mkdir xyz, mkdir mutliple folders
8. touch
-- creates a empty .txt file, if file is already present file will be opened in write mode.
9. rmdir
-- removes directory (folder) only if it is empty
10. rm
-- remove files
11. open
-- open filename, open foldername
12. mv
-- move / rename , mv exp.pdf Exp.pdf (rename) , mv exp.pdf fold/ (move exp into fold folder)
13. cp
-- copy, cp ex.pdf EX.pdf (in the directory EX.pdf is created which is a copy of ex.pdf)
14. head
-- first lines, head ex.pdf -n 10 (first 10 lines of EX.pdf)
15. tail
-- last lines, tail ex.pdf -n 10 (last 10 lines of EX.pdf)
16. date
-- displays current date time
17. redircting ouptut
-- date > text.txt (overrides text), date >> text.txt (appends text)
18. cat
-- cat f1 f2 (displays f1.txt + f2.txt)
19. echo
-- echo "hi"( print hi in terminal), echo "hi" > text.txt, echo "hi" >> text.txt
20. sort
-- sort text.txt
21. uniq
-- removes same adjacent values
22. find
-- (find -name 'te'), (find -name '*t*' = find file which contains t in it)
23. du
-- finds the disk usage , storage used ( du exFolder )
24. df
-- disk free space available
25. history
-- previous commands, (history | less)- few history ,(history | exam) - history commands which included exam
26. ps
-- proccess, display what programmes are running
27. top
-- display process and update sorted information
28. gzip
-- (gzip -k file) creates zip version of file
29. gunzip
-- (gunzip file.gz) unzips compressedfile
Reference Links :
https://youtu.be/5OdVJbNCSsoReference Links :
https://takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/Baiscs :
https://youtu.be/EAR7De6Goz4C++ STL
https://youtu.be/RRVYpIET_RUTime & Space Complexity
https://youtu.be/FPu9Uld7W-EPattern Problems
https://youtu.be/tNm_NNSB3_wMath Problems
https://youtu.be/1xNbjMdbjugGiven an array of N integers, write a program to implement the Bubble sorting algorithm.
Question ID : 0106231625
Problem : https://practice.geeksforgeeks.org/problems/bubble-sort/1
Solution : https://youtu.be/HGk_ypEuS24?t=1062
Given an unsorted array of N integers, write a program to implement the Selection sorting algorithm.
Question ID : 0106231657
Problem : https://practice.geeksforgeeks.org/problems/selection-sort/1
Solution : https://youtu.be/HGk_ypEuS24?t=167
Given an unsorted array of N integers, write a program to implement the Insertion sorting algorithm.
Question ID : 0106231926
Problem : https://practice.geeksforgeeks.org/problems/insertion-sort/0
Solution : https://youtu.be/HGk_ypEuS24?t=1899
Given two sorted arrays A[] and B[] of size N and M. The task is to merge both the arrays into a single array in non-decreasing order.
Question ID : 0106231948
Problem : https://www.interviewbit.com/blog/merge-two-sorted-arrays/
Given an array arr[], its starting position l and its ending position r. Sort the array using merge sort algorithm.
Question ID : 0106232013
Problem : https://practice.geeksforgeeks.org/problems/merge-sort/1
Solution : https://youtu.be/ogjf7ORKfd8?t=75
Question ID : 0206230938
Problem : https://practice.geeksforgeeks.org/problems/counting-sort/1
Solution : https://youtu.be/7zuGmKfUt7s
Given a unsorted array, sort is using divide, conquer, partition.
Question ID : 0206230954
Problem : https://www.codingninjas.com/codestudio/problems/quick-sort_983625
Solution : https://youtu.be/WIrA4YexLRQ
Find the largest element in array
Question ID : 0206231026
Problem : https://bit.ly/3Pld280
Solution : https://youtu.be/37E9ckMDdTk?t=522
Find the second largest element in array
Question ID : 0206231037
Problem : https://bit.ly/3pFvBcN
Solution : https://youtu.be/37E9ckMDdTk?t=815
Check whether the given array is sorted
Question ID : 0206231043
Problem : https://practice.geeksforgeeks.org/problems/check-if-an-array-is-sorted0701/1
Solution : https://youtu.be/37E9ckMDdTk?t=1722
Remove duplicates from sorted array
Question ID : 0206231053
Problem : https://bit.ly/3w7b6ck
Solution : https://youtu.be/37E9ckMDdTk?t=1891
Given an array arr[] of size N, the task is to left rotate the array 1 index
Question ID : 0206231107
Problem : https://bit.ly/3dnn9vC
Solution : https://youtu.be/wvcQg43_V8U?t=61
Given an array arr[] of size N, the task is to left rotate the array K indexes
Question ID : 0206231108
Problem : https://bit.ly/3dnn9vC
Solution : https://youtu.be/wvcQg43_V8U?t=486
Given an array arr[] of N positive integers. Push all the zeros of the given array to the right end of the array while maitaining the order of non-zero elements.
Question ID : 0206231208
Problem : https://bit.ly/3PrGIjT
Solution : https://youtu.be/wvcQg43_V8U?t=1633
Given an array arr[] sorted in ascending order of size N and an integer K. Check if K is present in the array or not. If it is present return the index, or -1.
Question ID : 0206231216
Problem : https://bit.ly/3KcpHcB
Solution : https://youtu.be/wvcQg43_V8U?t=2465
Union of two arrays can be defined as the common and distinct elements in the two arrays.
Given two sorted arrays of size n and m respectively, find their union.
Question ID : 0206231224
Problem : https://bit.ly/3Ap7Onp
Solution : https://youtu.be/wvcQg43_V8U?t=2584
You are given two arrays 'A' and 'B' of size 'N' and 'M' respectively. Both these arrays are sorted in non-decreasing order. You have to find the intersection of these two arrays.
Intersection of two arrays is an array that consists of all the common elements occurring in both arrays.
Question ID : 0206231256
Problem : http://bit.ly/3KSSx3Z
Solution : https://youtu.be/wvcQg43_V8U?t=3551
Give a vector, interger n. Actually the vector should contain first n natural numbers, but unfortunately one number got missed, find out the missing number.
Question ID : 0206231351
Problem : https://bit.ly/3A2pKTh
Solution : https://youtu.be/bYWLJb3vCWY?t=57
You are given an array ‘ARR’ of length ‘N’ consisting of only ‘0’s and ‘1’s. Your task is to determine the maximum length of the consecutive number of 1’s.
Question ID : 0206231359
Problem : http://bit.ly/3ZFZji5
Solution : https://youtu.be/bYWLJb3vCWY?t=1123
Given a sorted array A[] of N positive integers having all the numbers occurring exactly twice, except for one number which will occur only once.
Find the number occurring only once.
Question ID : 0206231406
Problem : https://bit.ly/3dudCD8
Solution : https://youtu.be/bYWLJb3vCWY?t=1370
Given a boolean 2D array of n x m dimensions where each row is sorted. Find the 0-based index of the first row that has the maximum number of 1 's.
Question ID : 0206231421
Problem : https://bit.ly/3QNDw2W
Given an array containing N positive integers and an integer K., Your task is to find the length of the longest Sub-Array with the sum of the elements equal to the given value K.
Question ID : 0206231429
Problem : https://takeuforward.org/data-structure/longest-subarray-with-given-sum-k/
Solution : https://youtu.be/frf7qxiN2qU?t=162
Given an array containing N positive + negative integers and an integer K., Your task is to find the length of the longest Sub-Array with the sum of the elements equal to the given value K.
Question ID : 0206231514
Problem : https://bit.ly/3dyZdp3
Solution : https://takeuforward.org/arrays/longest-subarray-with-sum-k-postives-and-negatives/
Sam want to read exactly ‘TARGET’ number of pages. He has an array ‘BOOK’ containing the number of pages for ‘N’ books. Return YES/NO, if it is possible for him to read any 2 books and he can meet his ‘TARGET’ number of pages.
Question ID : 0206231748
Problem : https://bit.ly/3SVYU8f
Solution : https://youtu.be/UXDSeD9mN-k?t=50
Given an array A of N elements. Find the majority element in the array. A majority element in an array A of size N is an element that appears more than N/2 times in the array.
Question ID : 0206231805
Problem : https://bit.ly/3SSpeA3
Solution : https://youtu.be/nP_ns3uSh80?t=47
Given an array Arr[] of N integers. Find the contiguous sub-array(containing at least one number) which has the maximum sum and return its sum.
Question ID : 0206231823
Problem : https://bit.ly/3dzyloY
Solution : https://youtu.be/w_KEocd__20
Given an array, find maximum sum of smallest and second smallest elements chosen from all possible sub-arrays. More formally, if we write all (nC2) sub-arrays of array of size >=2 and find the sum of smallest and second smallest, then our answer will be maximum sum among them.
Question ID : 0206231844
Problem : https://practice.geeksforgeeks.org/problems/max-sum-in-sub-arrays0824/0
Given an unsorted array Arr of N positive and negative numbers. Your task is to create an array of alternate positive and negative numbers without changing the relative order of positive and negative numbers.
If any of the positive and negative numbers are completed. we will continue with the remaining signed elements
Question ID : 0206231858
Problem : https://bit.ly/3Qr3sSs
Solution : https://youtu.be/h4aBagy4Uok?t=44
Implement the next permutation, which rearranges the list of numbers into Lexicographically next greater permutation of list of numbers. If such arrangement is not possible, it must be rearranged to the lowest possible order i.e. sorted in an ascending order. You are given an list of numbers arr[ ] of size N.
Question ID : 0206231912
Problem : https://bit.ly/3dug78u
Solution : https://youtu.be/JDOXKqF60RQ?t=43
Given an array A of positive integers. Your task is to find the leaders in the array. An element of array is leader if it is greater than or equal to all the elements to its right side. The rightmost element is always a leader.
Question ID : 0206231948
Problem : https://bit.ly/3bZqbGc
Solution : https://youtu.be/cHrH9CQ8pmY?t=39
Given an array of positive integers. Find the length of the longest sub-sequence such that elements in the subsequence are consecutive integers, the consecutive numbers can be in any order.
Question ID : 0206231958
Problem : https://bit.ly/3ApytAD
Solution : https://youtu.be/oO5uLE7EUlM?t=52
You are given a matrix 'MATRIX' of dimension 'N' x 'M'. Your task is to make all the elements of row 'i' and column 'j' equal to 0 if any element in the ith row or jth column of the matrix is 0.
Question ID : 0206232012
Problem : https://bit.ly/3CukQke
Solution : https://youtu.be/N0MgLvceX7M?t=51
Given a square matrix of size N x N. The task is to rotate it by 90 degrees in anti-clockwise direction without using any extra space.
Question ID : 0206232029
Problem : https://bit.ly/3PqpeV8
Solution : https://youtu.be/Z0R2u6gd3GU?t=46
Question ID : 0206232038
Problem : https://bit.ly/3ppEJ53
Solution : https://youtu.be/3Zv-s9UUrFM?t=40
Given a positive integer N, return the Nth row of pascal's triangle.
Pascal's triangle is a triangular array of the binomial coefficients formed by summing up the elements of previous row.
Question ID : 0306231018
Problem : https://bit.ly/3C95qlR
Solution : https://youtu.be/bR7mQgwQ_o8?t=47
You are given an array ‘ARR’ containing ‘N’ integers.Return all the unique triplets [ARR[i], ARR[j], ARR[k]] such that i != j, j != k and k != i and their sum is equal to zero.
Question ID : 0306231053
Problem : https://bit.ly/3X34JSI
Solution : https://youtu.be/DhFh8Kw7ymk?t=40
Given an array of integers and another number. Find all the unique quadruple from the given array that sums up to the given number.
Question ID : 0306231122
Problem : https://bit.ly/3It5SyP
Solution : https://youtu.be/eD95WRfh81c?t=50
Largest subarray with 0 sum
Question ID : 0306231152
Problem : https://bit.ly/3w5QSzC
Solution : https://youtu.be/xmguZ6GbatA?t=11
Given head of a linkedList, create and insert a node at the end, begining of list.
Question ID : 0306231410
Problem : https://bit.ly/3w9pEIt
Given a singly linked list and an integer x.Delete x th node from the singly linked list.
Question ID : 0306231419
Problem : https://bit.ly/3Apg5aX
Given a singly linked list. The task is to find the length of the linked list, where length is defined as the number of nodes in the linked list.
Question ID : 0306231427
Problem : https://bit.ly/3Po7tpf
Given a singly linked list of N nodes. The task is to find the middle of the linked list. For example, if the linked list is
1-> 2->3->4->5, then the middle node of the list is 3.
If there are two middle nodes(in case, when N is even), print the second middle element.
Question ID : 0306231433
Problem : https://bit.ly/3dAjkn1
Solution : https://youtu.be/sGdwSH8RK-o?t=9
Given a linked list of N nodes. The task is to reverse this list.
Question ID : 0306231441
Problem : https://bit.ly/3zY03mT
Solution : https://youtu.be/iRtLEoL-r-g?t=7
Given a linked list of N nodes. The task is to check if the linked list has a loop. Linked list can contain self loop.
Question ID : 0606230746
Problem : https://bit.ly/3QN8PLn
Solution : https://youtu.be/354J83hX7RI
Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null.
Question ID : 0606230759
Problem : https://leetcode.com/problems/linked-list-cycle-ii/
Solution : https://youtu.be/QfbOhn0WZ88
Given a linked list of size N. The task is to check whether a given Linked List contains a loop or not and if the loop is present then return the count of nodes in a loop or else return 0.
Question ID : 0606230838
Problem : https://bit.ly/3dyXL6m
Given a singly linked list of size N of integers. The task is to check if the given linked list is palindrome or not.
Question ID : 0606230916
Problem : https://bit.ly/3JVrnXJ
Solution : https://youtu.be/-DtNInqFUXs?t=22
Given the head of a linked list, remove the nth node from the end of the list and return its head.
Question ID : 0606231002
Problem : https://leetcode.com/problems/remove-nth-node-from-end-of-list/
Solution : https://youtu.be/Lhu3MsXZy-Q
Given a linked list of N nodes where nodes can contain values 0s, 1s, and 2s only. The task is to segregate 0s, 1s, and 2s linked list such that all zeros segregate to head side, 2s at the end of the linked list, and 1s in the mid of 0s and 2s.
Question ID : 0606231420
Problem : https://bit.ly/3Ceotvr
Given the heads of two singly linked-lists headA and headB, return the node at which the two lists intersect. If the two linked lists have no intersection at all, return null.
Question ID : 0606231429
Problem : https://leetcode.com/problems/intersection-of-two-linked-lists/
Solution : https://youtu.be/u4FWXfgS8jw?t=47
A number N is represented in Linked List such that each digit corresponds to a node in linked list. You need to add 1 to it.
Question ID : 0606231503
Problem : https://bit.ly/3piCTD3
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.
Question ID : 0606231804
Problem : https://leetcode.com/problems/add-two-numbers/
Solution : https://youtu.be/LBVsXSMOIk4
Given the head of a linked list, rotate the list to the right by k places.
Question ID : 0606231842
Problem : https://bit.ly/3JXvemY
Solution : https://youtu.be/9VPm6nEbVPA?t=26
Given a Linked List of size N, where every node represents a sub-linked-list and contains two pointers:
(i) a next pointer to the next node,
(ii) a bottom pointer to a linked list where this node is head.
Each of the sub-linked-list is in sorted order.
Flatten the Link List such that all the nodes appear in a single level while maintaining the sorted order.
Note: The flattened list will be printed using the bottom pointer instead of the next pointer
Question ID : 0606231925
Problem : https://bit.ly/3w9TKf8
Solution : https://youtu.be/ysytSSXpAI0
Given the head of a linked list, reverse the nodes of the list k at a time, and return the modified list.
k is a positive integer and is less than or equal to the length of the linked list. If the number of nodes is not a multiple of k then left-out nodes, in the end, should remain as it is.
You may not alter the values in the list's nodes, only nodes themselves may be changed.
Question ID : 0606232044
Problem : https://leetcode.com/problems/reverse-nodes-in-k-group/
Solution : https://youtu.be/Of0HPkk3JgI
Question ID : 0606232151
Problem : https://bit.ly/3dDuLdO
Given a link list of size N, modify the list such that all the even numbers appear before all the odd numbers in the modified list. The order of appearance of numbers within each segregation should be same as that in the original list.
NOTE: Don't create a new linked list, instead rearrange the provided one.
Question ID : 0706231112
Problem : https://bit.ly/3A3aeqe
Question ID : 0706231309
Problem : https://leetcode.com/problems/majority-element-ii/
Solution : https://youtu.be/vwZj1K0e9U8
Given two sorted arrays arr1[] and arr2[] of sizes n and m in non-decreasing order. Merge them in sorted order without using any extra space. Modify arr1 so that it contains the first N elements and modify arr2 so that it contains the last M elements.
Question ID : 0706231341
Problem : https://bit.ly/3zRzmAo
Solution : https://youtu.be/n7uwj04E0I4
Given a collection of Intervals, the task is to merge all of the overlapping Intervals.
Question ID : 0706231349
Problem : https://bit.ly/3zRz904
Solution : https://youtu.be/IexN60k62jo
Given an unsorted array Arr of size N of positive integers. One number 'A' from set {1, 2,....,N} is missing and one number 'B' occurs twice in array. Find these two numbers.
Question ID : 0706231902
Problem : https://bit.ly/3zWZoCs
Solution : https://youtu.be/2D0D8HE6uak
Given an array arr of N integers and an integer K, find the number of subsets of arr having XOR of elements as K.
Question ID : 0706231929
Problem : https://bit.ly/3jLfElm
Solution : https://youtu.be/eZr-6p0B7ME
Inversion Count: For an array, inversion count indicates how far (or close) the array is from being sorted. If array is already sorted then the inversion count is 0. If an array is sorted in the reverse order then the inversion count is the maximum.
Formally, two elements a[i] and a[j] form an inversion if a[i] > a[j] and i < j.
Question ID : 0706232001
Problem : https://bit.ly/3GJcuYj
Solution : https://youtu.be/AseUmwVNaoY
Given an integer array nums, return the number of reverse pairs in the array.
A reverse pair is a pair (i, j) where: i < j and nums[i] > 2 * nums[j].
Question ID : 0706232149
Problem : https://leetcode.com/problems/reverse-pairs/
Solution : https://youtu.be/0e4bZaP3MDI
Given an integer array nums, find a subarray that has the largest product, and return the product.
Question ID : 0806230743
Problem : https://bit.ly/3VPdyyq
Solution : https://youtu.be/hnswaLJvr6g
Given a sorted array of size N and an integer K, find the position(0-based indexing) at which K is present in the array using binary search.
Question ID : 1006231212
Problem : https://bit.ly/3QtKBpO
Solution : https://youtu.be/MHf6awe89xw
Given a sorted array arr[] of size N without duplicates, and given a value x. Floor of x is defined as the largest element K in arr[] such that K is smaller than or equal to x.
Question ID : 1006231242
Problem : https://bit.ly/3Cf398N
Solution : https://youtu.be/6zhGS79oQ4k
Given a sorted array arr[] of size N without duplicates, and given a value x. Floor of x is defined as the largest element K in arr[] such that K is larger than or equal to x.
Question ID : 1006231252
Problem : https://bit.ly/3Cf398N
Solution : https://youtu.be/6zhGS79oQ4k
Question ID : 1006231845
Problem : https://bit.ly/3QuCFEP
Solution : https://youtu.be/hjR1IYVx9lY
Given a sorted array Arr of size N and a number X, you need to find the number of occurrences of X in Arr.
Question ID : 1006231903
Problem : https://bit.ly/3SVcOqW
Solution : https://youtu.be/hjR1IYVx9lY
Given a sorted and rotated array A of N distinct elements which is rotated at some point, and given an element key. The task is to find the index of the given element key in the array A. The whole array A is given as the range to search.
Question ID : 1106230810
Problem : https://bit.ly/3OmIp5d
Solution : https://youtu.be/5qGrJbHhqFs
Question ID : 1106230835
Problem : https://bit.ly/3MCdLTY
Solution : https://youtu.be/w2G2W8l__pc
A sorted(in ascending order) array A[ ] with distinct elements is rotated at some unknown point, the task is to find the minimum element in it.
Question ID : 1106230941
Problem : https://bit.ly/41My2dR
Solution : https://youtu.be/nhEMDKMB44g
Given an ascending sorted rotated array Arr of distinct integers of size N. The array is right rotated K times. Find the value of K.
Question ID : 1106231006
Problem : https://bit.ly/3pMzTCh
Solution : https://youtu.be/jtSiWTPLwd0
Given a matrix mat[][] of size N x M, where every row and column is sorted in increasing order, and a number X is given. The task is to find whether element X is present in the matrix or not.
Question ID : 1106231133
Problem : https://bit.ly/3dAwi3Z
Solution : https://youtu.be/ZYpYur0znng
A peak element in a 2D grid is an element that is strictly greater than all of its adjacent neighbors to the left, right, top, and bottom.
Given a 0-indexed m x n matrix mat where no two adjacent cells are equal, find any peak element mat[i][j] and return the length 2 array [i,j].
Question ID : 1106231343
Problem : https://leetcode.com/problems/find-a-peak-element-ii/
Given a row wise sorted matrix of size R*C where R and C are always odd, find the median of the matrix.
Question ID : 1106231759
Problem : https://bit.ly/3PvwuPk
Solution : https://youtu.be/63fPPOdIr2c
Given N piles of bananas, the ith pile has piles[i] bananas and H hours time until guards return (N <= H).
Find the minimum (S) bananas to eat per hour such that Koko can eat all the bananas within H hours.
Each hour, Koko chooses some pile of bananas and eats S bananas from that pile. If the pile has less than S bananas, then she consumes all of them, and wont eat any more bananas during that hour.
Question ID : 1106231858
Problem : https://bit.ly/3LSY491
Given an array arr[] of N weights. Find the least weight capacity of a boat to ship all weights within D days.
The ith weight has a weight of arr[i]. Each day, we load the boat with weights given by arr[i].We may not load more weight than the maximum weight capacity of the ship.
Note: You have to load weights on the boat in the given order.
Question ID : 1106231928
Problem : https://bit.ly/3PBInmS
Question ID : 1206230922
Problem : https://bit.ly/3K1HwL4
Solution : https://youtu.be/NTop3VTjmxk
You are given an array consisting of n integers which denote the position of a stall. You are also given an integer k which denotes the number of aggressive cows.
You are given the task of assigning stalls to k cows such that the minimum distance between any two of them is the maximum possible.
Question ID : 1206231030
Problem : https://bit.ly/3rBuE5Z
Solution : https://youtu.be/wSOfYesTBRk
You have N books, each with Ai number of pages. M students need to be allocated contiguous books, with each student getting at least one book.
Out of all the permutations, the goal is to find the permutation where the student with the most pages allocated to him gets the minimum number of pages, out of all possible permutations.
Question ID : 1206231040
Problem : https://bit.ly/3QMrMxP
Solution : https://youtu.be/gYmWHvRHu-s
Given a valid parentheses string s, consider its primitive decomposition: s = P1 + P2 + ... + Pk, where Pi are primitive valid parentheses strings.
Return s after removing the outermost parentheses of every primitive string in the primitive decomposition of s
Question ID : 1206231206
Problem : https://bit.ly/3rzwRix
Given a String S, reverse the string without reversing its individual words. Words are separated by dots.
Question ID : 1206231223
Problem : https://bit.ly/3SXyWB4
Question ID : 1206231227
Problem : https://bit.ly/3UII5yp
Given an array of N strings, find the longest common prefix among all strings present in the array.
Question ID : 1206231729
Problem : https://bit.ly/3QKCyVu
Given two strings 'str1' and 'str2', check if these two strings are isomorphic to each other.
Two strings str1 and str2 are called isomorphic if there is a one to one mapping possible for every character of str1 to every character of str2 while preserving the order.
Note: All occurrences of every character in str1 should map to the same character in str2
Question ID : 1206231740
Problem : https://bit.ly/3QwynwI
Question ID : 1206231749
Problem : https://bit.ly/3K0HHq5
Given an increasing sequence a[], we need to find the K-th missing contiguous element in the increasing sequence which is not present in the sequence. If no k-th missing element is there output -1.
Question ID : 1206231801
Problem : https://bit.ly/3bUFY9l
For example , "" , " ( ) ( ) " , and " ( ) ( ( ) ( ) ) " and VPS's (with nesting depths 0 , 1, and 2), and " ) ( " and " ( ( ) " are not VPS's.
Given a VPS represented as string S , return the nesting depth of S.
Question ID : 1206231844
Problem : https://bit.ly/3xYlR1F
Given a string in roman no format (s) your task is to convert it to an integer . Various symbols and their values are given below. I 1 ,V 5 , X 10, L 50, C 100, D 500, M 1000
Question ID : 1206231850
Problem : https://bit.ly/3AqBlNv
Your task is to implement the function atoi. The function takes a string(str) as argument and converts it to an integer and returns it.
Question ID : 1206231856
Problem : https://bit.ly/3QUHBmf
Given two positive integers L, R and a digit D, find out all the good numbers in the range [L, R], which do not contain the digit D.
A number is a good number if it's every digit is larger than the sum of digits which are on the right side of that digit.
9620 is good as (2 > 0, 6 > 2+0, 9 > 6+2+0)
Question ID : 1206231939
Problem : https://bit.ly/3w6SucH
Given an integer, K. Generate all binary strings of size k without consecutive 1’s.
Question ID : 1206231954
Problem : https://bit.ly/3QJ0vwc
Question ID : 1206232002
Problem : https://bit.ly/3K5keUw
Given a string S, Find all the possible subsequences of the String in lexicographically-sorted order.
Question ID : 1206232009
Problem : https://bit.ly/3STXz1t
Solution : https://youtu.be/b7AYbpM5YrE
Given a list arr of N integers, print sums of all subsets in it.
Question ID : 1206232030
Problem : https://bit.ly/3C9GQRS
Given an array of integers and a sum B, find all unique combinations in the array where the sum is equal to B. The same number may be chosen from the array any number of times to make B.
Question ID : 1306230925
Problem : https://bit.ly/3C9bJ91
Solution : https://youtu.be/OyZFFqQtu98
Question ID : 1306230946
Problem : https://bit.ly/3VgczZ2
Solution : https://youtu.be/G1fRTGRxXU8
You are given an integer array nums that may contain duplicates. Your task is to return all possible subsets. Return only unique subsets and they can be in any order.
Question ID : 1306231034
Problem : https://bit.ly/3MlAvWF
Solution : https://youtu.be/RIn3gOkbhQE
Find all valid combinations of K numbers that sum upto to N such that the following conditions are true:
Only number 1 through 9 are used.
Each number is used atmost once.
Return the list of all possible valid combinations.
Note: The list must not contain the same combination twice, and the combinations returned in any order.
Question ID : 1306231102
Problem : https://bit.ly/3CMZFul
Given a keypad as shown in the diagram, and an N digit number which is represented by array a[ ], the task is to list all words which are possible by pressing these numbers.
Question ID : 1306231237
Problem : https://bit.ly/3K1INBO
Given a string s, sort it in decreasing order based on the frequency of the characters.
Return the sorted string.
Question ID : 1306231706
Problem : https://leetcode.com/problems/sort-characters-by-frequency/
In case of conflict, return the substring which occurs first ( with the least starting index).
Question ID : 1406230842
Problem : https://bit.ly/3CeQ27D
Solution : https://youtu.be/XYQecbcd6_c
Given a string of lowercase alphabets, count all possible substrings (not necessarily distinct) that have exactly k distinct characters.
Question ID : 1406231054
Problem : https://bit.ly/3CfQfYi
Question ID : 1406231136
Problem : https://leetcode.com/problems/sum-of-beauty-of-all-substrings/
Solution : https://youtu.be/5XjJs5SBN8g
Given a 2D board of letters and a word. Check if the word exists in the board. The word can be constructed from letters of adjacent cells only. ie - horizontal or vertical neighbors.
The same letter cell can not be used more than once.
Question ID : 1406231714
Problem : https://practice.geeksforgeeks.org/problems/word-search/1
Consider a rat placed at (0, 0) in a square matrix of order N * N. It has to reach the destination at (N - 1, N - 1). Find all possible paths that the rat can take to reach from source to destination. The directions in which the rat can move are 'U', 'D', 'L', 'R'. Value 0 at a cell in the matrix represents that it is blocked and rat cannot move to it while value 1 at a cell in the matrix represents that rat can be travel through it.
Question ID : 1406231733
Problem : https://practice.geeksforgeeks.org/problems/rat-in-a-maze-problem/1
Solution : https://youtu.be/bLGZhJlt4y0
Given an incomplete Sudoku configuration in terms of a 9 x 9 2-D square matrix ( grid[][] ), the task to find a solved Sudoku.
Question ID : 1406231744
Problem : https://practice.geeksforgeeks.org/problems/solve-the-sudoku-1587115621/1
Solution : https://youtu.be/FWAIf_EVUKE
The n-queens puzzle is the problem of placing n queens on a (n×n) chessboard such that no two queens can attack each other.
Given an integer n, find all distinct solutions to the n-queens puzzle.
Question ID : 1406231918
Problem : https://practice.geeksforgeeks.org/problems/n-queen-problem0315/1
Solution : https://youtu.be/i05Ju7AftcM
Given a value N, a stack st, insert N in the bottom of stack.
Question ID : 1506231033
Solution : https://www.geeksforgeeks.org/program-to-insert-an-element-at-the-bottom-of-a-stack/
Question ID : 1506231042
Problem : https://bit.ly/3podAiY
Solution : https://youtu.be/SW14tOda_kI
Given a stack, the task is to sort it such that the top of the stack has the greatest element.
Question ID : 1506231110
Problem : https://practice.geeksforgeeks.org/problems/sort-a-stack/1
Solution : https://youtu.be/SjDq1xYxC44
Assume you are an awesome parent of N children and want to give your children some cookies out of given M cookies. But, you should give each child atmost one cookie.
Each child i has a greed factor greed [ i ], which is the minimum size of cookie that the child will be content with; and each cookie j has a size sz [ j ]. If sz [ j ] >= greed [ i ], we can assign the cookie j to the child ith, and the child i will be content.
Your goal is to maximize the number of your content children and return the maximum number.
Question ID : 1506231616
Problem : https://bit.ly/3Wl3PBd
Given an infinite supply of each denomination of Indian currency { 1, 2, 5, 10, 20, 50, 100, 200, 500, 2000 } and a target value N.
Find the minimum number of coins and/or notes needed to make the change for Rs N. You must return the list containing the value of coins required.
Question ID : 1506231622
Problem : https://bit.ly/3Ka7xYU
Solution : https://youtu.be/mVg9CfJvayM
You are an owner of lemonade island, each lemonade costs $5. Customers are standing in a queue to buy from you and order one at a time (in the order specified by bills).
Each customer will only buy one lemonade and pay with either a $5, $10, or $20 bill. You must provide the correct change to each customer so that the net transaction is that the customer pays $5.
NOTE: At first, you do not have any bill to provide changes with. You can provide changes from the bills that you got from the previous customers.
Given an integer array bills of size N where bills [ i ] is the bill the ith customer pays, return true if you can provide every customer with the correct change, or false otherwise.
Question ID : 1506231709
Problem : https://bit.ly/3DoFGRx
Given an expression string x. Examine whether the pairs and the orders of {,},(,),[,] are correct in exp.
Question ID : 1506231716
Problem : https://bit.ly/3K6ulZA
Given weights and values of N items, we need to put these items in a knapsack of capacity W to get the maximum total value in the knapsack.
Note: Unlike 0/1 knapsack, you are allowed to break the item.
Question ID : 1506231738
Problem : https://bit.ly/3PsqOFL
Solution : https://youtu.be/F_DDzYnxO14
There is one meeting room in a firm. There are N meetings in the form of (start[i], end[i]) where start[i] is start time of meeting i and end[i] is finish time of meeting i.
What is the maximum number of meetings that can be accommodated in the meeting room when only one meeting can be held in the meeting room at a particular time?
Question ID : 1506231841
Problem : https://bit.ly/3A6Ob1Y
Solution : https://youtu.be/II6ziNnub1Q
Given arrival and departure times of all trains that reach a railway station. Find the minimum number of platforms required for the railway station so that no train is kept waiting.
Question ID : 1506231934
Problem : https://bit.ly/3bXX5Hm
Solution : https://youtu.be/dxVcMDI7vyI
Given a set of N jobs where each jobi has a deadline and profit associated with it.
Each job takes 1 unit of time to complete and only one job can be scheduled at a time. We earn the profit associated with job if and only if the job is completed by its deadline.
Find the number of jobs done and the maximum profit.
Question ID : 1506232023
Problem : https://bit.ly/3Pttpzj
Solution : https://youtu.be/LjPx4wQaRIs
Given a root of binary tree, find its preorder traversal.
Question ID : 1606231130
Problem : https://bit.ly/3Cb4VIh
Solution : https://youtu.be/RlUu72JrOCQ
Given a root of binary tree, find its postorder traversal.
Question ID : 1606231142
Problem : https://bit.ly/3SZauQ4
Solution : https://youtu.be/COQOU6klsBg
Given a root of binary tree, find its inorder traversal.
Question ID : 1606231150
Problem : https://bit.ly/3QzNDbU
Solution : https://youtu.be/Z_NEgBgbRVI
Given a root of binary tree, find its level order traversal.
Question ID : 1606231232
Problem : https://bit.ly/3K6t9VR
Solution : https://youtu.be/EoAsWbO7sqg
Given a root of binary tree, find its preorder traversal.
Question ID : 1606231857
Problem : https://bit.ly/3Cb4VIh
Solution : https://youtu.be/Bfqd8BsPVuw
Given a root of binary tree, find its inorder traversal.
Question ID : 1606231955
Problem : https://bit.ly/3QzNDbU
Solution : https://youtu.be/lxTGsVXjwvM
Given a root of binary tree, find the Postorder Traversal of it.
Question ID : 1706230831
Problem : https://bit.ly/3Cb5Wjz
Solution : https://youtu.be/2YBhNLodD8Q
Question ID : 1706230937
Solution : https://youtu.be/ySp2epYvgTE
Given root of binary tree, find its height.
Question ID : 1706231048
Problem : https://bit.ly/3CitiDM
Solution : https://youtu.be/eD3tmO66aBA
Given a binary tree, find if it is height balanced or not.
A tree is height balanced if difference between heights of left and right subtrees is not more than one for all nodes of tree.
Question ID : 1706231054
Problem : https://bit.ly/3K9YbfB
Solution : https://youtu.be/Yt50Jfbd8Po
The diameter of a tree (sometimes called the width) is the number of nodes on the longest path between two end nodes.
Question ID : 1706231108
Problem : https://bit.ly/3wcfG9l
Solution : https://youtu.be/Rezetez59Nk
Given a binary tree, the task is to find the maximum path sum. The path may start and end at any node in the tree.
Question ID : 1706231150
Problem : https://bit.ly/3QAFjbW
Solution : https://youtu.be/WszrfSwMz58
Given two binary trees, the task is to find if both of them are identical or not.
Question ID : 1706231242
Problem : https://bit.ly/3c2K52Z
Solution : https://youtu.be/BhuvF_-PWS0
Given root of Binary Tree. Find the Zig-Zag Level Order Traversal of the Binary Tree.
Question ID : 1706231709
Problem : https://bit.ly/3K4mwn5
Solution : https://youtu.be/3OXWEdlIGl4
Given a Binary Tree, find its Boundary Traversal. The traversal should be in the following order: leftBoundary, leafNodes, rightBoundary
Question ID : 1706231736
Problem : https://bit.ly/3AsfgOK
Solution : https://youtu.be/0ca1nvR0be4
Given a Binary Tree, find the vertical traversal of it starting from the leftmost level to the rightmost level.
If there are multiple nodes passing through a vertical line, then they should be printed as they appear in level order traversal of the tree.
Question ID : 1706231849
Problem : https://bit.ly/3pqu1er
Solution : https://youtu.be/q_a6lpbKJdw
Given below is a binary tree. The task is to print the top view of binary tree. Top view of a binary tree is the set of nodes visible when the tree is viewed from the top.
Question ID : 1706231903
Problem : https://bit.ly/3PsvE5T
Solution : https://youtu.be/Et9OCDNvJ78
Given a binary tree, print the bottom view from left to right. A node is included in bottom view if it can be seen when we look at the tree from bottom.
Question ID : 1706231910
Problem : https://bit.ly/3Asftl0
Solution : https://youtu.be/0FtVY6I4pB8
Given a Binary Tree, return Left view of it. Left view of a Binary Tree is set of nodes visible when tree is visited from Left side.
Question ID : 1706231916
Problem : https://bit.ly/3PCqyE9
Solution : https://youtu.be/KV4mRzTjlAk
Given a Binary Tree, find Right view of it. Right view of a Binary Tree is set of nodes visible when tree is viewed from right side.
Question ID : 1706231924
Problem : https://practice.geeksforgeeks.org/problems/right-view-of-binary-tree/1
Solution : https://youtu.be/KV4mRzTjlAk
Given a Binary Tree. Check whether it is Symmetric or not, i.e. whether the binary tree is a Mirror image of itself or not.
Question ID : 1706231939
Problem : https://bit.ly/3PCqBzP
Solution : https://youtu.be/nKggNAiEpBE
Given a Binary Tree of size N, you need to find all the possible paths from root node to all the leaf node's of the binary tree.
Question ID : 1806230804
Problem : https://bit.ly/3QA600D
Solution : https://youtu.be/fmflMqVOC7k
Given a Binary Tree A containing N nodes. You need to find the path from Root to a given node B.
Question ID : 1806230817
Problem : https://www.interviewbit.com/problems/path-to-given-node/
Solution : https://youtu.be/fmflMqVOC7k
Given a Binary Tree with all unique values and two nodes value, n1 and n2. The task is to find the lowest common ancestor of the given two nodes. We may assume that either both n1 and n2 are present in the tree or none of them are present.
LCA: It is the first common ancestor of both the nodes n1 and n2 from bottom of tree.
Question ID : 1806230931
Problem : https://bit.ly/3popvgG
Solution : https://youtu.be/_-QHfMDde90
Given a Binary Tree, find the maximum width of it. Maximum width is defined as the maximum number of nodes at any level.
The width of one level is defined as the length between the end-nodes (the leftmost and rightmost non-null nodes), where the null nodes between the end-nodes that would be present in a complete binary tree extending down to that level are also counted into the length calculation.
Question ID : 1806230941
Problem : https://leetcode.com/problems/maximum-width-of-binary-tree/
Solution : https://youtu.be/ZbybYvcVLks
Given a Binary Tree. Check whether all of its nodes have the value equal to the sum of their child nodes.
Question ID : 1806231045
Problem : https://www.codingninjas.com/codestudio/problems/childrensumproperty_790723
Solution : https://youtu.be/fnmisPM6cVo
Given a binary tree, a target node in the binary tree, and an integer value k, find all the nodes that are at distance k from the given target node. No parent pointers are available.
Question ID : 1806231112
Problem : https://bit.ly/3QytIu6
Solution : https://youtu.be/i9ORlEy6EsI
Given a binary tree and a node data called target. Find the minimum time required to burn the complete binary tree if the target is set on fire. It is known that in 1 second all nodes connected to a given node get burned. That is its left child, right child, and parent.
Question ID : 1806231142
Problem : https://bit.ly/3wcg7k1
Solution : https://youtu.be/2r5wLmQfD6g
You are given the root of a complete binary tree. Your task is to find the count of nodes.
A complete binary tree is a binary tree whose, all levels except the last one are completely filled, the last level may or may not be completely filled and Nodes in the last level are as left as possible.
Question ID : 1806231644
Problem : https://bit.ly/3EoPFXM
Solution : https://youtu.be/u-yWemKGWO0
Given 2 Arrays of Inorder and preorder traversal. The tree can contain duplicate elements. Construct a tree and print the Postorder traversal.
Question ID : 1806231905
Problem : https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
Solution : https://youtu.be/aZNaLrVebKQ
Given inorder and postorder traversals of a Binary Tree in the arrays in[] and post[] respectively. The task is to construct the binary tree from these traversals.
Question ID : 1806232004
Problem : https://bit.ly/3wbFiTI
Solution : https://youtu.be/LgLRTaEMRVc
Serialization is to store a tree in an array so that it can be later restored and Deserialization is reading tree back from the array. Now your task is to complete the function serialize which stores the tree into an array A[ ] and deSerialize which deserializes the array to the tree and returns it.
Question ID : 1906230815
Problem : https://leetcode.com/problems/serialize-and-deserialize-binary-tree/
Solution : https://youtu.be/-YbXySKJsX8
Given the root of a binary tree, flatten the tree into a "linked list":
The "linked list" should use the same Node 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.
Question ID : 1906230956
Problem : https://bit.ly/3PFzwko
Solution : https://youtu.be/sWf7k1x9XR4
Given an array of integers in[] representing inorder traversal of elements of a binary tree. Return true if the given inorder traversal can be of a valid Binary Search Tree.
Question ID : 1906231019
Problem : https://practice.geeksforgeeks.org/problems/search-a-node-in-bst/1
Solution : https://youtu.be/KcNt6v_56cc
Given a Binary Search Tree. The task is to find the minimum valued element in this given BST.
Question ID : 1906231031
Problem : https://practice.geeksforgeeks.org/problems/minimum-element-in-bst/1
Given a BST and a number X, find Ceil of X.
Note: Ceil(X) is a number that is either equal to X or is immediately greater than X.
Question ID : 1906231038
Problem : https://practice.geeksforgeeks.org/problems/implementing-ceil-in-bst/1
Solution : https://youtu.be/KSsk8AhdOZA
You are given a BST(Binary Search Tree) with n number of nodes and value x. your task is to find the greatest value node of the BST which is smaller than or equal to x.
Note: when x is smaller than the smallest node of BST then returns -1.
Question ID : 1906231048
Problem : https://bit.ly/3TSbXXE
Solution : https://youtu.be/xm_W1ub-K-w
Given a BST and a key K. If K is not present in the BST, Insert a new Node with a value equal to K into the BST.
Note: If K is already present in the BST, don't modify the BST.
Question ID : 1906231058
Problem : https://practice.geeksforgeeks.org/problems/insert-a-node-in-a-bst/1
Solution : https://youtu.be/FiFiNvM29ps
Given a Binary Search Tree and a node value X. Delete the node with the given value X from the BST. If no node with value x exists, then do not make any change.
Question ID : 1906231350
Problem : https://practice.geeksforgeeks.org/problems/delete-a-node-from-bst/1
Solution : https://youtu.be/kouxiP_H5WE
Given a BST and an integer K. Find the Kth Smallest element in the BST using O(1) extra space.
Question ID : 1906231751
Problem : https://practice.geeksforgeeks.org/problems/find-k-th-smallest-element-in-bst/1
Solution : https://youtu.be/f-sj7I5oXEI
Given the root of a binary tree. Check whether it is a BST or not.
Question ID : 1906231806
Problem : https://bit.ly/3poHDqN
Solution : https://youtu.be/f-sj7I5oXEI
Given a Binary Search Tree (with all values unique) and two node values. Find the Lowest Common Ancestors of the two nodes in the BST.
Question ID : 1906231832
Problem : https://practice.geeksforgeeks.org/problems/lowest-common-ancestor-in-a-bst/1
Solution : https://youtu.be/cX_kPV_foZc
Given an array of integers preorder, which represents the preorder traversal of a BST (i.e., binary search tree), construct the tree and return its root.
Question ID : 1906231907
Problem : https://practice.geeksforgeeks.org/problems/preorder-to-postorder4423/1
Solution : https://youtu.be/UmJT3j26t1I
There is BST given with the root node with the key part as an integer only. You need to find the in-order successor and predecessor of a given key. If either predecessor or successor is not found, then set it to NULL.
Note:- In an inorder traversal the number just smaller than the target is the predecessor and the number just greater than the target is the successor.
Question ID : 2006231147
Problem : https://practice.geeksforgeeks.org/problems/predecessor-and-successor/1
Solution : https://youtu.be/SXKAD2svfmI
Given two BSTs, return elements of both BSTs in sorted form.
Question ID : 2006231217
Problem : https://practice.geeksforgeeks.org/problems/merge-two-bst-s/1
Question ID : 2006231356
Problem : https://leetcode.com/problems/binary-search-tree-iterator/
Solution : https://youtu.be/D2jMcmxU4bs
Given a Binary Search Tree and a target sum. Check whether there's a pair of Nodes in the BST with value summing up to the target sum.
Question ID : 2006231821
Problem : https://practice.geeksforgeeks.org/problems/find-a-pair-with-given-target-in-bst/1
Solution : https://youtu.be/ssL3sHwPeb4
You are given the root of a binary search tree(BST), where exactly two nodes were swapped by mistake. Fix (or correct) the BST by swapping them back. Do not change the structure of the tree.
Question ID : 2106230815
Problem : https://bit.ly/3PBJwea
Solution : https://youtu.be/ZWGW7FminDM
Given a binary tree. Find the size of its largest subtree that is a Binary Search Tree.
Note: Here Size is equal to the number of nodes in the subtree.
Question ID : 2106230943
Problem : https://practice.geeksforgeeks.org/problems/largest-bst/1
Solution : https://youtu.be/X0oXMdtUDwo
Given the root of a binary tree, invert [mirror] the tree, and return its root.
Question ID : 2106231136
Problem : https://leetcode.com/problems/invert-binary-tree/
Solution : https://youtu.be/XcY9aUlLP_s
Given a binary tree, connect the nodes that are at the same level. The structure of the tree Node contains an addition nextRight pointer for this purpose.
Question ID : 2106231146
Problem : https://practice.geeksforgeeks.org/problems/95423710beef46bd66f8dbb48c510b2c320dab05/1
Solution : https://youtu.be/zc9rCww9ZXs
Given a n-ary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
Question ID : 2106231157
Problem : https://leetcode.com/problems/maximum-depth-of-n-ary-tree/
Solution : https://youtu.be/Wg243C9gjrw
Given the root of a binary tree, replace the value of each node in the tree with the sum of all its cousins' values.
Two nodes of a binary tree are cousins if they have the same depth with different parents.
Return the root of the modified tree.
Question ID : 2106231405
Problem : https://leetcode.com/problems/cousins-in-binary-tree-ii/
Solution : https://youtu.be/TF8jF0PxavM
Given a binary tree, find its minimum depth.
The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.
Question ID : 2106231843
Problem : https://leetcode.com/problems/minimum-depth-of-binary-tree/
Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the path equals targetSum.
Question ID : 2106231854
Problem : https://leetcode.com/problems/path-sum/
Given the root of a binary tree and an integer targetSum, return all root-to-leaf paths where the sum of the node values in the path equals targetSum. Each path should be returned as a list of the node values, not node references.
Question ID : 2106231927
Problem : https://leetcode.com/problems/path-sum-ii/
Given an integer array nums, return true if there exists a triple of indices (i, j, k) such that
i < j < k and nums[i] < nums[j] < nums[k]. If no such indices exists, return false.
Question ID : 2206231007
Problem : https://leetcode.com/problems/increasing-triplet-subsequence/
Given an integer n, return the number of structurally unique BST's (binary search trees) which has exactly n nodes of unique values from 1 to n.
Question ID : 2206231039
Problem : https://leetcode.com/problems/unique-binary-search-trees/
Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binary search tree.
Question ID : 2206231056
Problem : https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/
Given an integer n, return all the structurally unique BST's (binary search trees), which has exactly n nodes of unique values from 1 to n
Question ID : 2206231427
Problem : https://leetcode.com/problems/unique-binary-search-trees-ii/
You are given the root of a binary tree containing digits from 0 to 9 only. Each root-to-leaf path in the tree represents a number. For example, the root-to-leaf path 1 -> 2 -> 3 represents the number 123.
Question ID : 2206231431
Problem : https://leetcode.com/problems/sum-root-to-leaf-numbers/
Given the root of a binary tree, return the sum of all left leaves. A leaf is a node with no children. A left leaf is a leaf that is the left child of another node.
Question ID : 2206231454
Problem : https://leetcode.com/problems/sum-of-left-leaves/
Given an n-ary tree, return the level order traversal of its nodes' values.
Question ID : 2206231504
Problem : https://leetcode.com/problems/n-ary-tree-level-order-traversal/
Given the root of a binary tree, return all root-to-leaf paths in any order.
Question ID : 2206231527
Problem : https://leetcode.com/problems/binary-tree-paths/
Given the root of a binary tree, return the leftmost value in the last row of the tree.
Question ID : 2206231546
Problem : https://leetcode.com/problems/find-bottom-left-tree-value/
Given the root of a binary tree, return an array of the largest value in each row of the tree (0-indexed).
Question ID : 2206231750
Problem : https://leetcode.com/problems/find-largest-value-in-each-tree-row/
Given the root of a binary tree, construct a string consisting of parenthesis and integers from a binary tree with the preorder traversal way, and return it.
Omit all the empty parenthesis pairs that do not affect the one-to-one mapping relationship between the string and the original binary tree.
Question ID : 2206231858
Problem : https://leetcode.com/problems/construct-string-from-binary-tree/
Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus the sum of all keys greater than the original key in BST.
Question ID : 2206231919
Problem : https://leetcode.com/problems/convert-bst-to-greater-tree/
Given the root of a binary tree, return the sum of every tree node's tilt.
The tilt of a tree node is the absolute difference between the sum of all left subtree node values and all right subtree node values.
Question ID : 2306231142
Problem : https://leetcode.com/problems/binary-tree-tilt
Given the root of a binary search tree (BST) with duplicates, return all the mode(s) (i.e., the most frequently occurred element) in it.
If the tree has more than one mode, return them in any order.
Question ID : 2306231200
Problem : https://leetcode.com/problems/find-mode-in-binary-search-tree
Given the root of an n-ary tree, return the preorder traversal of its nodes' values.
Question ID : 2306231215
Problem : https://leetcode.com/problems/n-ary-tree-preorder-traversal/
Given the root of an n-ary tree, return the postorder traversal of its nodes' values.
Question ID : 2306231220
Problem : https://leetcode.com/problems/n-ary-tree-postorder-traversal/
Given the root of a binary tree, return the average value of the nodes on each level in the form of an array.
Question ID : 2306231359
Problem : https://leetcode.com/problems/average-of-levels-in-binary-tree/
You are given an integer array nums with no duplicates. A maximum binary tree can be built recursively from nums using the following algorithm:
Create a root node whose value is the maximum value in nums.
Question ID : 2306231500
Problem : https://leetcode.com/problems/maximum-binary-tree/
Given the root of a Binary Search Tree (BST), return the minimum absolute difference between the values of any two different nodes in the tree.
Question ID : 2306231513
Problem : https://leetcode.com/problems/minimum-absolute-difference-in-bst/
Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-node. If the node has two sub-nodes, then this node's value is the smaller value among its two sub-nodes. More formally, the property root.val = min(root.left.val, root.right.val) always holds. Given such a binary tree, you need to output the second minimum value in the set made of all the nodes' value in the whole tree.
If no such second minimum value exists, output -1 instead.
Question ID : 2306231703
Problem : https://leetcode.com/problems/second-minimum-node-in-a-binary-tree/
Given the root of a binary tree, return the same tree where every subtree (of the given tree) not containing a 1 has been removed.
Question ID : 2306231746
Problem : https://leetcode.com/problems/binary-tree-pruning/
Consider all the leaves of a binary tree, from left to right order, the values of those leaves form a leaf value sequence.
Question ID : 2306231808
Problem : https://leetcode.com/problems/leaf-similar-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.
Question ID : 2306231944
Problem : https://leetcode.com/problems/subtree-of-another-tree/
Given the root of a binary tree, return the length of the longest path, where each node in the path has the same value. This path may or may not pass through the root.
The length of the path between two nodes is represented by the number of edges between them.
Question ID : 2306232157
Problem : https://leetcode.com/problems/longest-univalue-path/
Given the root of a binary search tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only one right child.
Question ID : 2406230816
Problem : https://leetcode.com/problems/increasing-order-search-tree
Given an integer n, return a list of all possible full binary trees with n nodes. Each node of each tree in the answer must have Node.val == 0.
Each element of the answer is the root node of one possible tree. You may return the final list of trees in any order.
A full binary tree is a binary tree where each node has exactly 0 or 2 children.
Question ID : 2406230847
A binary tree is uni-valued if every node in the tree has the same value.
Given the root of a binary tree, return true if the given tree is uni-valued, or false otherwise.
Question ID : 2406231041
Problem : https://leetcode.com/problems/univalued-binary-tree/
Given the root of a binary tree with unique values and the values of two different nodes of the tree x and y, return true if the nodes corresponding to the values x and y in the tree are cousins, or false otherwise.
Two nodes of a binary tree are cousins if they have the same depth with different parents.
Question ID : 2406231215
Problem : https://leetcode.com/problems/cousins-in-binary-tree/
Given two integer arrays, preorder and postorder where preorder is the preorder traversal of a binary tree of distinct values and postorder is the postorder traversal of the same tree, reconstruct and return the binary tree.
If there exist multiple answers, you can return any of them.
Question ID : 2406231252
Problem : https://leetcode.com/problems/construct-binary-tree-from-preorder-and-postorder-traversal/
Given the root of a binary tree, the depth of each node is the shortest distance to the root
Return the smallest subtree such that it contains all the deepest nodes in the original tree.
Question ID : 2406231526
Problem : https://leetcode.com/problems/smallest-subtree-with-all-the-deepest-nodes/
You are given the root of a binary tree where each node has a value in the range [0, 25] representing the letters 'a' to 'z'.
Return the lexicographically smallest string that starts at a leaf of this tree and ends at the root.
Question ID : 2406231552
Problem : https://leetcode.com/problems/smallest-string-starting-from-leaf/
Given the root of a binary tree and two integers val and depth, add a row of nodes with value val at the given depth depth.
Question ID : 2406231913
Problem : https://leetcode.com/problems/add-one-row-to-tree/
You are given two binary trees root1 and root2.
Imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need to merge the two trees into a new binary tree. The merge rule is that if two nodes overlap, then sum node values up as the new value of the merged node. Otherwise, the NOT null node will be used as the node of the new tree.
Return the merged tree.
Question ID : 2406232111
Given the root of a binary search tree and the lowest and highest boundaries as low and high, trim the tree so that all its elements lies in [low, high]. Trimming the tree should not change the relative structure of the elements that will remain in the tree.
Question ID : 2406232141
Given a binary array 'ARR' of size 'N', your task is to find the longest sequence of continuous 1’s that can be formed by replacing at-most 'K' zeroes by ones. Return the length of this longest sequence of continuous 1’s.
Question ID : 2506230627
Problem : https://www.codingninjas.com/codestudio/problems/maximum-consecutive-ones_892994
Given a 2-dimensional matrix of size ‘N’ x ‘M’, rotate the elements of the matrix clockwise.
The output matrix is generated by rotating the elements of the input matrix in a clockwise direction. Note that every element is rotated only once.
Question ID : 2506230632
Given a directed graph. The task is to do Breadth First Traversal of this graph starting from 0.
Question ID : 2506231217
Problem : https://practice.geeksforgeeks.org/problems/bfs-traversal-of-graph/1
Solution : https://youtu.be/-tgVpUgsQ5k
You are given a connected undirected graph. Perform a Depth First Traversal of the graph.
Question ID : 2506231234
Problem : https://practice.geeksforgeeks.org/problems/depth-first-traversal-for-a-graph/1
Solution : https://youtu.be/Qzf1a--rhp8
Given an undirected graph with V vertices. We say two vertices u and v belong to a single province if there is a path from u to v or v to u. Your task is to find the number of provinces.
Question ID : 2506231237
Problem : https://practice.geeksforgeeks.org/problems/number-of-provinces/1
Solution : https://youtu.be/ACzkVtewUYA
Given a grid of size n*m (n is the number of rows and m is the number of columns in the grid) consisting of '0's (Water) and '1's(Land). Find the number of islands.
Question ID : 2506231521
Problem : https://bit.ly/3oT9Ndg
Solution : https://youtu.be/muncqlKJrH0
Given a grid of dimension nxm where each cell in the grid can have values 0, 1 or 2 which has the following meaning:
0 : Empty cell
1 : Cells have fresh oranges
2 : Cells have rotten oranges
We have to determine what is the minimum time required to rot all oranges.
Question ID : 2506231534
Problem : https://bit.ly/3R4htWb
Solution : https://youtu.be/yf3oUhkvqA0
Given a coordinate (sr, sc) of the flood fill, and a pixel value newColor, "flood fill" the image.
Question ID : 2506231552
Problem : https://practice.geeksforgeeks.org/problems/flood-fill-algorithm1856/1
Solution : https://youtu.be/C-2_uSRli8o
Find the distance of the nearest 1 in the grid for each cell.
Question ID : 2506231745
Problem : https://practice.geeksforgeeks.org/problems/distance-of-nearest-cell-having-1-1587115620/1
Solution : https://youtu.be/edXdVwkYHF8
Given a matrix mat of size N x M where every element is either O or X.
Replace all O with X that are surrounded by X.
Question ID : 2606230825
Problem : https://practice.geeksforgeeks.org/problems/replace-os-with-xs0052/1
Solution : https://youtu.be/BtdgAys4yMk
Find the number of land cells in grid for which we cannot walk off the boundary of the grid in any number of moves.
Question ID : 2606231029
Problem : https://practice.geeksforgeeks.org/problems/number-of-enclaves/1
Solution : https://youtu.be/rxKcepXQgU4
Given a 10 grid. You have to find the number of distinct islands where a group of connected 1s (horizontally or vertically) forms an island. Two islands are considered to be distinct if and only if one island is not equal to another (not rotated or reflected).
Question ID : 2606231716
Problem : https://practice.geeksforgeeks.org/problems/number-of-distinct-islands/1
Solution : https://youtu.be/7zmgQSJghpo
Given an undirected graph with V vertices and E edges, check whether it contains any cycle or not. Graph is in the form of adjacency list where adj[i] contains all the nodes ith node is having edge with.
Question ID : 2606231753
Problem : https://practice.geeksforgeeks.org/problems/detect-cycle-in-an-undirected-graph/1
Solution : https://youtu.be/BPlrALf1LDU
Given an undirected graph with V vertices and E edges, check whether it contains any cycle or not. Graph is in the form of adjacency list where adj[i] contains all the nodes ith node is having edge with.
Question ID : 2606231758
Problem : https://practice.geeksforgeeks.org/problems/detect-cycle-in-an-undirected-graph/1
Solution : https://youtu.be/zQ3zgFypzX4
Given an adjacency list of a graph adj of V no. of vertices having 0 based index. Check whether the graph is bipartite or not.
Question ID : 2606231812
Problem : https://practice.geeksforgeeks.org/problems/bipartite-graph/1
Solution : https://youtu.be/-vu34sct1g8
Given an adjacency list of a graph adj of V no. of vertices having 0 based index. Check whether the graph is bipartite or not.
Question ID : 2606231838
Problem : https://practice.geeksforgeeks.org/problems/bipartite-graph/1
Solution : https://youtu.be/KG5YFfR0j8A
Given a Directed Graph with V vertices (Numbered from 0 to V-1) and E edges, check whether it contains any cycle or not.
Question ID : 2606231917
Problem : https://practice.geeksforgeeks.org/problems/detect-cycle-in-a-directed-graph/1
Solution : https://youtu.be/9twcmtQj4DU
A node is a terminal node if there are no outgoing edges. A node is a safe node if every possible path starting from that node leads to a terminal node. You have to return an array containing all the safe nodes of the graph.
Question ID : 2606232028
Problem : https://practice.geeksforgeeks.org/problems/eventual-safe-states/1
Solution : https://youtu.be/uRbJ1OF9aYM
Given a Directed Acyclic Graph (DAG) with V vertices and E edges, Find any Topological Sorting of that Graph. linear ordering i.e if there is a edge btw u -> v , v appears first.
Question ID : 2706231113
Problem : https://practice.geeksforgeeks.org/problems/topological-sort/1
Solution : https://youtu.be/5lZ0iJMrUMk
Given a Directed Acyclic Graph (DAG) with V vertices and E edges, Find any Topological Sorting of that Graph. linear ordering i.e if there is a edge btw u -> v , v appears first.
Question ID : 2706231133
Problem : https://practice.geeksforgeeks.org/problems/topological-sort/1
Solution : https://youtu.be/73sneFXuTEg
Given a Directed Graph with V vertices (Numbered from 0 to V-1) and E edges, check whether it contains any cycle or not.
Question ID : 2706231151
Problem : https://practice.geeksforgeeks.org/problems/detect-cycle-in-a-directed-graph/1
Solution : https://youtu.be/iTBaI90lpDQ
There are a total of n tasks you have to pick, labeled from 0 to n-1. Some tasks may have prerequisites tasks, for example to pick task 0 you have to first finish tasks 1,
which is expressed as a pair: [0, 1].
Given the total number of n tasks and a list of prerequisite pairs of size m. Find a ordering of tasks you should pick to finish all tasks.
Question ID : 2706231356
Problem : https://practice.geeksforgeeks.org/problems/course-schedule/1
Solution : https://youtu.be/WAOfKpxYHR8
A node is a terminal node if there are no outgoing edges. A node is a safe node if every possible path starting from that node leads to a terminal node. You have to return an array containing all the safe nodes of the graph.
Question ID : 2706231411
Problem : https://practice.geeksforgeeks.org/problems/eventual-safe-states/1
Solution : https://youtu.be/2gtg3VsDGyc
Given a sorted dictionary of an alien language having N words and k starting alphabets of standard dictionary. Find the order of characters in the alien language.
Question ID : 2706231500
Problem : https://practice.geeksforgeeks.org/problems/alien-dictionary/1
Solution : https://youtu.be/U3N_je7tWAs
Given a Directed Acyclic Graph of N vertices from 0 to N-1 and a 2D Integer array(or vector) edges[ ][ ] of length M, where there is a directed edge from edge[i][0] to edge[i][1] with a distance of edge[i][2] for all i, 0<=i.
Find the shortest path from src(0) vertex to all the vertices and if it is impossible to reach any vertex, then return -1 for that vertex.
Question ID : 2706231621
Problem : https://practice.geeksforgeeks.org/problems/shortest-path-in-undirected-graph/1?
Solution : https://youtu.be/ZUFQfFaU-8U
You are given an Undirected Graph having unit weight, Find the shortest path from src to all the vertex and if it is unreachable to reach any vertex, then return -1 for that vertex.
Question ID : 2706231712
Problem : https://practice.geeksforgeeks.org/problems/shortest-path-in-undirected-graph-having-unit-distance/1
Solution : https://youtu.be/C4gxoTaI71U
Given two distinct words startWord and targetWord, and a list denoting wordList of unique words of equal lengths. Find the length of the shortest transformation sequence from startWord to targetWord.
Question ID : 2806230812
Problem : https://practice.geeksforgeeks.org/problems/word-ladder/1
Solution : https://youtu.be/tRPda0rcf8E
Given two distinct words startWord and targetWord, and a list denoting wordList of unique words of equal lengths. Find all shortest transformation sequence(s) from startWord to targetWord.
Question ID : 2806231026
Problem : https://practice.geeksforgeeks.org/problems/word-ladder-ii/1
Solution : https://youtu.be/tRPda0rcf8E
Given a weighted, undirected and connected graph of V vertices and an adjacency list adj where adj[i] is a list of lists containing two integers where the first integer of each list j denotes there is edge between i and j , second integers corresponds to the weight of that edge .
You are given the source vertex S and You to Find the shortest distance of all the vertex's from the source vertex S
Question ID : 2806231115
Problem : https://practice.geeksforgeeks.org/problems/implementing-dijkstra-set-1-adjacency-matrix/1
Solution : https://youtu.be/V6H1qAeB-l4
You are given a weighted undirected graph having n vertices numbered from 1 to n and m edges describing there are edges between a to b with some weight, find the shortest path between the vertex 1 and the vertex n.
Question ID : 2806231428
Problem : https://practice.geeksforgeeks.org/problems/shortest-path-in-weighted-undirected-graph/1
Solution : https://youtu.be/rp1SMw7HSO8
Given a n * m grid, each element can be 0 or 1. You need to find the shortest distance between a given source cell to a destination cell. The path can only be created out of a cell if its value is 1.
Question ID : 2806231458
Problem : https://practice.geeksforgeeks.org/problems/shortest-path-in-a-binary-maze-1655453161/1
Solution : https://youtu.be/U5Mw4eyUmw4
You are given an undirected weighted graph of n nodes (0-indexed),connecting the nodes a and b with a probability of success of traversing that edge succProb[i].Given two nodes start and end.
find the path with the maximum probability of success to go from start to end and return its success probability.
Question ID : 2806231518
Problem : https://leetcode.com/problems/path-with-maximum-probability/
Solution : https://youtu.be/aPThR7YBCAM
You are given heights, a 2D array. where heights[row][col] = the height of cell (row, col).
You have to travel from (0, 0) to (rows-1, columns-1).find a route that requires the minimum effort.
A route's effort is the maximum absolute difference in heights between two consecutive cells of the route.
Question ID : 2806231923
Problem : https://practice.geeksforgeeks.org/problems/path-with-minimum-effort/1
Solution : https://youtu.be/0ytpZyiZFhA
There are n cities and m edges connected by some number of flights. You are given an array flights where flights[i] = [fromi, toi, pricei] indicates that there is a flight from the city fromi to city toi with cost pricei.
You are also given three integers src, dst, and k, return the cheapest price from src to dst with at most k stops.
Question ID : 2806232002
Problem : https://practice.geeksforgeeks.org/problems/cheapest-flights-within-k-stops/1
Solution : https://youtu.be/9XybHVqTHcQ
Given start, end and an array arr of n numbers. At each step, start is multiplied with any number in the array and then mod operation with 100000 is done to get the new start.
Your task is to find the minimum steps in which end can be achieved starting from start. If it is not possible to reach end, then return -1.
Question ID : 2906230747
Problem : https://practice.geeksforgeeks.org/problems/minimum-multiplications-to-reach-end/1
Solution : https://youtu.be/_BvEJ3VIDWw
You are given an integer n and a 2D integer array roads where roads[i] = [ui, vi, timei] means that there is a road between intersections ui and vi that takes timei minutes to travel.
You want to know in how many ways you can travel from intersection 0 to intersection n - 1 in the shortest amount of time.
Return the number of ways you can arrive at your destination in the shortest amount of time.
Question ID : 2906230801
Problem : https://practice.geeksforgeeks.org/problems/number-of-ways-to-arrive-at-destination/1
Solution : https://youtu.be/_-0mx0SmYxA
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.
Note: If the Graph contains a negative cycle then return an array consisting of only -1.
Question ID : 2906231036
Problem : https://practice.geeksforgeeks.org/problems/distance-from-the-source-bellman-ford-algorithm/1
Solution : https://youtu.be/0vVofAhAYjc
The problem is to find the shortest distances between every pair of vertices in a given edge-weighted directed graph. The graph is represented as an adjacency matrix of size n*n. Matrix[i][j] denotes the weight of the edge from i to j. If Matrix[i][j]=-1, it means there is no edge from i to j.
Question ID : 2906231052
Problem : https://youtu.be/YbY8cVwWAvw
Solution : https://practice.geeksforgeeks.org/problems/implementing-floyd-warshall2042/1
There are n cities numbered from 0 to n-1. Given the array edges of a bidirectional and weighted edge, and given the integer distance Threshold.
You need to find out a city with the smallest number of cities that are reachable through some path and whose distance is at most Threshold Distance.
Question ID : 2906231141
Solution : https://youtu.be/PwMVNSJ5SLI
You are given an n x n integer matrix grid where each value grid[i][j] represents height of the cell (i, j).
You can travel from a cell to another 4-directionally adjacent cell if and only the height of the both cells are at most T. You can travel infinite distances in zero time but you must stay within the boundaries of the grid during your travel.
You are currently at cell (0 , 0) and the value of T is 0.and you wish to go to cell (n-1,m-1).
Find the minimum time it will take to reach the cell (n, m) if the value of T increase by 1 every second.
Question ID : 2906231234
Problem : https://practice.geeksforgeeks.org/problems/minimum-travel-time/1
Given a weighted, undirected and connected graph of V vertices and E edges. The task is to find the sum of weights of the edges of the Minimum Spanning Tree.
Question ID : 2906231438
Problem : https://practice.geeksforgeeks.org/problems/minimum-spanning-tree/1
Solution : https://youtu.be/mJcZjjKzeqk
Question ID : 2906231514
Solution : https://youtu.be/aBxjDBC4M1U
Given a weighted, undirected and connected graph of V vertices and E edges. The task is to find the sum of weights of the edges of the Minimum Spanning Tree.
Question ID : 2906231529
Problem : https://practice.geeksforgeeks.org/problems/minimum-spanning-tree/1
Solution : https://youtu.be/DMnDM_sxVig
You are given a graph with n vertices and m edges.
You can remove one edge from anywhere and add that edge between any two vertices in one operation.
Find the minimum number of operation that will be required to make the graph connected.
Question ID : 2906231554
Problem : https://practice.geeksforgeeks.org/problems/connecting-the-graph/1
Solution : https://youtu.be/FYrl7iz9_ZU
Return how many island are there in the matrix after each operation.You need to return an array of size k.
Question ID : 2906231929
Problem : https://practice.geeksforgeeks.org/problems/number-of-islands/1
Solution : https://youtu.be/Rn6B-Q4SNyA
You are given an n x n binary grid. A grid is said to be binary if every value in grid is either 1 or 0.
You can change at most one cell in grid from 0 to 1.
You need to find the largest group of connected 1's.
Question ID : 2906232011
Problem : https://practice.geeksforgeeks.org/problems/maximum-connected-group/1
Solution : https://youtu.be/lgiz0Oup6gM
There are n stones at some integer coordinate points on a 2D plane. Each coordinate point may have at most one stone.
You need to remove some stones.
A stone can be removed if it shares either the same row or the same column as another stone that has not been removed.
Question ID : 3006232047
Problem : https://practice.geeksforgeeks.org/problems/maximum-stone-removal-1662179442/1
Solution : https://youtu.be/OwMNX8SPavM
Given a Graph of V vertices and E edges and another edge(c - d), the task is to find if the given edge is a Bridge. i.e., removing the edge disconnects the graph.
Question ID : 3006230954
Problem : https://practice.geeksforgeeks.org/problems/bridge-edge-in-graph/1
here are n servers numbered from 0 to n - 1 connected by undirected server-to-server connections forming a network where connections[i] = [ai, bi] represents a connection between servers ai and bi. Any server can reach other servers directly or indirectly through the network.
A critical connection is a connection that, if removed, will make some servers unable to reach some other server.
Return all critical connections in the network in any order.
Question ID : 3006231001
Problem : https://leetcode.com/problems/critical-connections-in-a-network/
Solution : https://youtu.be/qrAub5z8FeA
There are n stairs, a person standing at the bottom wants to reach the top. The person can climb either 1 stair or 2 stairs at a time. Count the number of ways, the person can reach the top (order does matter).
Question ID : 0407231011
Problem : https://practice.geeksforgeeks.org/problems/count-ways-to-reach-the-nth-stair-1587115620/1
Solution : https://youtu.be/mLfjzJsN8us
Geek wants to climb from the 0th stair to the (n-1)th stair. At a time the Geek can climb either one or two steps. A height[N] array is also given. Whenever the geek jumps from stair i to stair j, the energy consumed in the jump is abs(height[i]- height[j]), where abs() means the absolute difference. return the minimum energy that can be used by the Geek to jump from stair 0 to stair N-1.
Question ID : 0407231134
Problem : https://practice.geeksforgeeks.org/problems/geek-jump/1
Solution : https://youtu.be/EgG3jsGoPvQ
There are n stones and an array of heights and Geek is standing at stone 1 and can jump to one of the following: Stone i+1, i+2, ... i+k stone and cost will be [hi-hj] is incurred, where j is the stone to land on. Find the minimum possible total cost incurred before the Geek reaches Stone N.
Question ID : 0407231203
Problem : https://practice.geeksforgeeks.org/problems/minimal-cost/1
Solution : https://youtu.be/Kmh3rhyEtB8
Given an array Arr of size N containing positive integers. Find the maximum sum of a subsequence such that no two numbers in the sequence should be adjacent in the array.
Question ID : 0407231238
Problem : https://practice.geeksforgeeks.org/problems/max-sum-without-adjacents2430/1
Solution : https://youtu.be/GrMBfJNk_NY
Geek is going for n days training program, he can perform any one of these three activities Running, Fighting, and Learning Practice. Each activity has some point on each day. as Geek wants to improve all his skills, he can't do the same activity on two consecutive days, help Geek to maximize his merit points as we were given a 2D array of n*3 points corresponding to each day and activity.
Question ID : 0407231853
Problem : https://practice.geeksforgeeks.org/problems/geeks-training/1
Solution : https://youtu.be/AE39gJYuRog
Given a A X B matrix with your initial position at the top-left cell, find the number of possible unique paths to reach the bottom-right cell of the matrix from the initial position.
Question ID : 0507231006
Problem : https://practice.geeksforgeeks.org/problems/number-of-unique-paths5339/1
Solution : https://youtu.be/sdE0A2Oxofw
You are given a grid of n * m having 0 and 1 respectively, 0 denotes space, and 1 denotes obstacle. Geek is located at top-left corner (i.e grid[0][0]) and wants to reach the bottom right corner of the grid. A geek can move either down or right at any point of time. return the total number of ways in which Geek can reach bottom right corner.
Question ID : 0507231106
Problem : https://practice.geeksforgeeks.org/problems/grid-path-2/1
Solution : https://youtu.be/TmhpgXScLyY
Given a square grid of size N, each cell of which contains integer cost which represents a cost to traverse through that cell, we need to find a path from top left cell to bottom right cell by which the total cost incurred is minimum.
Question ID : 0507231135
Problem : https://bit.ly/3q5sqfu
Solution : https://youtu.be/_rgTlyky1uQ
Given a triangle array, return the minimum path sum from top to bottom.
For each step, you may move to an adjacent number of the row below. More formally, if you are on index i on the current row, you may move to either index i or index i + 1 on the next row.
Question ID : 0507231145
Problem : https://leetcode.com/problems/triangle/
Solution : https://youtu.be/SrP-PiLSYC0
Given a NxN matrix of positive integers.
Starting from any column in row 0 return the largest sum of any of the paths up to row N-1.
Question ID : 0507231404
Problem : https://practice.geeksforgeeks.org/problems/path-in-matrix3805/1
Solution : https://youtu.be/N_aJ5qQbYA0
Given an array of non-negative integers, and a value sum, determine if there is a subset of the given set with sum equal to given sum.
Question ID : 0607230753
Problem : https://practice.geeksforgeeks.org/problems/subset-sum-problem-1611555638/1
Solution : https://youtu.be/fWX9xDmIzRI
Given an array arr of size n containing non-negative integers, the task is to divide it into two sets S1 and S2 such that the absolute difference between their sums is minimum and find the minimum difference
Question ID : 0607230850
Problem : https://practice.geeksforgeeks.org/problems/minimum-sum-partition3317/1
Solution : https://youtu.be/GS_OqZb2CWc
Question ID : 0607230858
Problem : https://practice.geeksforgeeks.org/problems/subset-sum-problem2014/1
Solution : https://youtu.be/7win3dcgo3k
Given an array arr[] of non-negative integers and an integer sum, the task is to count all subsets of the given array with a sum equal to a given sum.
Question ID : 0607231009
Problem : https://www.codingninjas.com/studio/problems/number-of-subsets_3952532
Solution : https://youtu.be/ZHyb-A2Mte4
Given an array arr, partition it into two subsets(possibly empty) such that their union is the original array. Let the sum of the element of these two subsets be S1 and S2.
Given a difference d, count the number of partitions in which S1 is greater than or equal to S2 and the difference S1 and S2 is equal to d.
Question ID : 0607231112
Problem : https://practice.geeksforgeeks.org/problems/partitions-with-given-difference/1
Solution : https://youtu.be/zoilQD1kYSg
given two integer arrays val[0..N-1] and wt[0..N-1] which represent values and weights associated with N items respectively. Also given an integer W which represents knapsack capacity,
find out the maximum value subset of val[] such that sum of the weights of this subset is smaller than or equal to W.
Question ID : 0607231149
Problem : https://practice.geeksforgeeks.org/problems/0-1-knapsack-problem0945/1
Solution : https://youtu.be/GqOmJHQZivw
You are given an array of ‘N’ distinct integers and an integer ‘X’ representing the target sum. You have to tell the minimum number of elements you have to take to reach the target sum ‘X’.
Question ID : 0607231522
Problem : https://www.codingninjas.com/studio/problems/minimum-elements_3843091
Solution : https://youtu.be/myPeWb3Y68A
You are given an array of ‘N’ distinct integers and an integer ‘X’ representing the target sum. You have to tell the no of ways of elements you have to take to reach the target sum ‘X’.
Question ID : 0607232217
Problem : https://www.codingninjas.com/studio/problems/ways-to-make-coin-change_630471
Solution : https://youtu.be/HgyouUi11zk
Given a set of N items, each with a weight and a value, represented by the array w[] and val[] respectively. Also, a knapsack with weight limit W.
The task is to fill the knapsack in such a way that we can get the maximum profit. Return the maximum profit.
Note: Each item can be taken any number of times.
Question ID : 0707230809
Problem : https://practice.geeksforgeeks.org/problems/knapsack-with-duplicate-items4201/1
Solution : https://youtu.be/OgvOZ6OrJoY
Given a rod of length N inches and an array of prices, price[]. price[i] denotes the value of a piece of length i. Determine the maximum value obtain.
Question ID : 0707230827
Problem : https://practice.geeksforgeeks.org/problems/rod-cutting0840/1
Solution : https://youtu.be/mO8XpGoJwuo
Given two sequences, find the length of longest subsequence present in both of them. Both the strings are of uppercase.
Question ID : 0707230846
Problem : https://practice.geeksforgeeks.org/problems/longest-common-subsequence-1587115620/1
Solution : https://youtu.be/NPZn9jBrX8U
You are given two strings s and t. Now your task is to print all longest common sub-sequences in lexicographical order.
Question ID : 0707231053
Problem : https://practice.geeksforgeeks.org/problems/print-all-lcs-sequences3413/1
Solution : https://youtu.be/-zI4mrF2Pb4
Given two strings. The task is to find the length of the longest common substring.
Question ID : 0707231144
Problem : https://practice.geeksforgeeks.org/problems/longest-common-substring1452/1
Solution : https://youtu.be/_wP9mWNPL5w
Given a String, find the longest palindromic subsequence.
Question ID : 0707231324
Problem : https://practice.geeksforgeeks.org/problems/longest-palindromic-subsequence-1612327878/1
Solution : https://youtu.be/6i_T5kkfv4A
Given a string of T & F, and integer k, we can change T to F or F to T atmost K times, Return the maximum number of consecutive 'T's or 'F's in the answer
Question ID : 0707231417
Problem : https://leetcode.com/problems/maximize-the-confusion-of-an-exam
Solution : https://youtu.be/gwhMrBPoEEw
Given a string, find the minimum number of characters to be inserted to convert it to palindrome.
Question ID : 0707231451
Problem : https://practice.geeksforgeeks.org/problems/form-a-palindrome1455/1
Solution : https://youtu.be/xPBLEj41rFU
Given two strings str1 and str2. The task is to remove or insert the minimum number of characters from/in str1 so as to transform it into str2.
Question ID : 0707231510
Problem : https://practice.geeksforgeeks.org/problems/minimum-number-of-deletions-and-insertions0209/1
Solution : https://youtu.be/yMnH0jrir0Q
Given two strings X and Y of lengths m and n respectively, find the length of the smallest string which has both, X and Y as its sub-sequences.
Question ID : 0707231518
Problem : https://practice.geeksforgeeks.org/problems/shortest-common-supersequence0322/1
Solution : https://youtu.be/xElxAuBcvsU
We are given two strings, ‘TEXT' and ‘S’. We have to calculate the no. of subsequences of ‘TEXT’, which are equal to ‘S’. Since the answer can be very large print it modulo (10^9)+7.
Question ID : 0707231916
Problem : https://www.codingninjas.com/studio/problems/subsequence-counting_3755256
Solution : https://youtu.be/nVG7eTiD2bY
Given two strings s and t. Return the minimum number of operations required to convert s to t.
Insert a character
Remove any character
Replace any character.
Question ID : 0707232043
Problem : https://practice.geeksforgeeks.org/problems/edit-distance3702/1
Solution : https://youtu.be/fJaKO8FbDdo
You are given a positive integer n representing n cities numbered from 1 to n. You are also given a 2D array roads where roads[i] = [ai, bi, distancei].
The score of a path between two cities is defined as the minimum distance of a road in this path.
Return the minimum possible score of a path between cities 1 and n.
Question ID : 0807230739
Problem : https://leetcode.com/problems/minimum-score-of-a-path-between-two-cities/
Solution : https://youtu.be/36sRR_lrgkI
You are given a positive integer array skill of even length n where skill[i] denotes the skill of the ith player. Divide the players into n / 2 teams of size 2 such that the total skill of each team is equal.
The chemistry of a team is equal to the product of the skills of the players on that team.
Return the sum of the chemistry of all the teams
Question ID : 0807230747
Problem : https://leetcode.com/problems/divide-players-into-teams-of-equal-skill/
Solution : https://youtu.be/B8pPSzKRFqk
Given two strings 'str' and a wildcard pattern 'pattern'.
‘ ? ’ – matches any single character
‘ * ’ – Matches any sequence of characters (including the empty sequence)
Question ID : 0807230756
Problem : https://practice.geeksforgeeks.org/problems/wildcard-pattern-matching/1
Solution : https://youtu.be/ZmlQ3vgAOMo
You are given an array/list 'prices' where the elements of the array represent the prices of the stock as they were yesterday and indices of the array represent minutes. Your task is to find and return the maximum profit you can make by buying and selling the stock. You can buy and sell the stock only once.
Question ID : 0807231041
Problem : https://www.codingninjas.com/studio/problems/stocks-are-profitable_893405
Solution : https://youtu.be/excAOvwF_Wk
The cost of stock on each day is given in an array A[] of size N. Find all the segments of days on which you buy and sell the stock so that in between those days for which profit can be generated.
Question ID : 0807231055
Problem : https://practice.geeksforgeeks.org/problems/stock-buy-and-sell-1587115621/1
You are given the prices of stock for n number of days.Find the maximum profit that you can make by buying and selling stock any number of times as you can't proceed with other transactions if you hold any transaction.
Question ID : 0807231134
Problem : https://practice.geeksforgeeks.org/problems/buy-stock-2/1
Solution : https://youtu.be/nGJmxkUJQGs
The bombs are represented array bombs[i] = [xi, yi, ri],
You may choose to detonate a single bomb. When a bomb is detonated, it will detonate all bombs that lie in its range. These bombs will further detonate the bombs that lie in their ranges.
Given the list of bombs, return the maximum number of bombs that can be detonated if you are allowed to detonate only one bomb
Question ID : 0807231244
Problem : https://leetcode.com/problems/detonate-the-maximum-bombs/
Solution : https://youtu.be/ajBbc7PrFzs
In daily share trading, a buyer buys shares in the morning and sells them on the same day. If the trader is allowed to make at most 2 transactions in a day, the second transaction can only start after the first one is complete (Buy->sell->Buy->sell). The stock prices throughout the day are represented in the form of an array of prices.
Given an array price of size N, find out the maximum profit that a share trader could have made.
Question ID : 0807231344
Problem : https://practice.geeksforgeeks.org/problems/buy-and-sell-a-share-at-most-twice/1
Solution : https://youtu.be/-uQGzhYj8BQ
You are given an integer array nums. A subsequence of nums is called a square streak if:
The length of the subsequence is at least 2, and after sorting the subsequence, each element (except the first element) is the square of the previous number.
Return the length of the longest square streak in nums, or return -1 if there is no square streak.
Question ID : 0807231847
Problem : https://leetcode.com/problems/longest-square-streak-in-an-array
Solution : https://youtu.be/jAfSRlvGJwM
You are given a array forts. forts[i] can be -1, 0, or 1 where:
-1 no fort, 0 enemy fort. 1 your fort.
Now you have decided to move your army from one of your forts at position i to an empty position j.
The army travels over enemy forts only. While moving the army, all the enemy forts that come in the way are captured.
Return the maximum number of enemy forts that can be captured. In case it is impossible to move your army, or you do not have any fort under your command, return 0.
Question ID : 0807231936
Problem : https://leetcode.com/problems/maximum-enemy-forts-that-can-be-captured/
Solution : https://youtu.be/iXaboKjGTmM
Given an undirected tree consisting of n vertices numbered from 0 to n-1, which has some apples in their vertices. You spend 1 second to walk over one edge of the tree. Return the minimum time in seconds you have to spend to collect all apples in the tree, starting at vertex 0 and coming back to this vertex.
Question ID : 0907230758
Problem : https://leetcode.com/problems/minimum-time-to-collect-all-apples-in-a-tree/
Solution : https://youtu.be/PE5qdXqgs6Y
You are given a list of stock prices, ‘prices’. Where ‘prices[i]’ represents the price on ‘i’th day. Your task is to calculate the maximum profit you can earn by trading stocks if you can only hold one stock at a time. After you sell your stock on the ‘i’th day, you can only buy another stock on ‘i + 2’ th day or later.
Question ID : 0907230942
Problem : https://www.codingninjas.com/studio/problems/best-time-to-buy-and-sell-stock-with-cooldown_3125969
Solution : https://youtu.be/IGIe46xw3YY
Given 'N' number of days and an array 'PRICES' of size 'N' price of the chocolate each day. and variable 'FEE' fee for the transaction. Find the maximum profit.
Question ID : 0907230957
Solution : https://youtu.be/k4eK-vEmnKg
Find the Longest Increasing Subsequence of the array.
Question ID : 0907231136
Problem : https://www.codingninjas.com/studio/problems/printing-longest-increasing-subsequence_8360670
Solution : https://youtu.be/IFfYfonAFGc
Array of distinct numbers. Your task is to return the largest subset of numbers from ‘arr’, such that any pair of numbers ‘a’ and ‘b’ from the subset satisfies the following: a % b == 0 or b % a == 0.
Question ID : 0907231233
Problem : https://www.codingninjas.com/studio/problems/divisible-set_3754960
Solution : https://youtu.be/gDuZwBW9VvM
string chain (str1, str2) means str2 = str1 + one character, find longest string chain
Question ID : 0907231407
Problem : https://www.codingninjas.com/studio/problems/longest-string-chain_3752111
Solution : https://youtu.be/YY8iBaYcc4g
Given an integer array ‘ARR’ of length ‘N’, return the number of longest increasing subsequences in it.
Question ID : 0907231537
Problem : https://www.codingninjas.com/studio/problems/number-of-longest-increasing-subsequence_3751627
Solution : https://youtu.be/cKVl1TFdNXg
You are given an array/list 'ARR' consisting of 'N' positive integers. A subsequence of 'ARR' is called bitonic if it is first increasing and then decreasing.
Question ID : 0907231751
Problem : https://www.codingninjas.com/studio/problems/longest-bitonic-sequence_1062688
Solution : https://youtu.be/y4vN0WNdrlg
You will be given an array p[] of size n + 1. Dimension of matrix Ai is p[i - 1]*p[i]. You need to find minimum number of multiplications needed to multiply the chain.
Question ID : 0907231835
Problem : https://www.codingninjas.com/studio/problems/matrix-chain-multiplication_624880
Solution : https://youtu.be/vRVfmbCFW7Y
You are given two strings of the same length s1 and s2 and a string baseStr.
We say s1[i] and s2[i] are equivalent characters.
Return the lexicographically smallest equivalent string of baseStr by using the equivalency information from s1 and s2.
Question ID : 1007231025
Problem : https://leetcode.com/problems/lexicographically-smallest-equivalent-string/description/
Solution : https://youtu.be/J6NfkPSUecQ
You are given chocolate of ‘N’ length. The chocolate is labeled from 0 to ‘N’. You are also given an array ‘CUTS’ of size ‘C’, denoting the positions at which you can do a cut. The order of cuts can be changed. The cost of one cut is the length of the chocolate to be cut. Therefore, the total cost is the sum of all the cuts. Print the minimum cost to cut the chocolate.
Question ID : 1007231123
Problem : https://www.codingninjas.com/studio/problems/cost-to-cut-a-chocolate_3208460
Solution : https://youtu.be/xwomavsC86c
Given a rod of length ‘N’ units. The rod can be cut into different sizes and each size has a cost associated with it. Determine the maximum cost obtained by cutting the rod and selling its pieces.
Question ID : 1007231136
Problem : https://www.codingninjas.com/studio/problems/rod-cutting-problem_800284
There are ‘N’ diamonds in a mine. The size of each diamond is given in the form of integer array ‘A’. If the miner mines a diamond, then he gets 'size of previous unmined diamond * size of currently mined diamond * size of next unmined diamond' number of coins.
find the max coins
Question ID : 1007231420
Problem : https://www.codingninjas.com/studio/problems/mining-diamonds_4244494
Solution : https://youtu.be/Yz4LlDSlkns
You are given an expression ‘EXP’ in the form of a string where operands will be : (TRUE and FALSE) and operators will be : (AND, OR, XOR). Now you have to find the number of ways we can parenthesize the expression such that it will evaluate to TRUE.
Question ID : 1007231437
Problem : https://www.codingninjas.com/studio/problems/boolean-evaluation_1214650
Solution : https://youtu.be/MM7fXopgyjw
partition s such that every partition string is a palindrome.Return all possible palindrome partitioning of s.
Question ID : 1007231523
Problem : https://www.codingninjas.com/studio/problems/palindrome-partitioning_626181
Solution : https://youtu.be/WBgsABoClE0
Given a string, make cuts in that string to make partitions containing substrings with size at least 1, and also each partition is a palindrome.Among all such valid partitions, return the minimum number of cuts to be made such that the resulting substrings in the partitions are palindromes.
Question ID : 1007231543
Problem : https://www.codingninjas.com/studio/problems/palindrome-partitioning-ll_873266
Solution : https://youtu.be/_H8V5hJUGd0
You have to divide the array into some subarrays of length atmost k such that each element is present in exactly one of the subarrays.After partitioning all the elements of each subarray will be changed to the maximum element present in that subarray. You have to maximize the sum of all the elements after partitioning.
Question ID : 1007231604
Problem : https://www.codingninjas.com/studio/problems/partition-array-for-maximum-sum_3755255
Solution : https://youtu.be/PhWWJmaKfMc
Given an array of integers heights representing the histogram's bar height,return the area of the largest rectangle in the histogram.
Question ID : 1007231716
Problem : https://leetcode.com/problems/largest-rectangle-in-histogram/
Solution : https://youtu.be/X0X6G-eWgQ8
Given a rows x cols binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.
Question ID : 1007231725
Problem : https://leetcode.com/problems/maximal-rectangle/
Solution : https://youtu.be/tOylVCugy9k
Given a m * n matrix of ones and zeros, return how many square submatrices have all ones.
Question ID : 1007231752
Problem : https://leetcode.com/problems/count-square-submatrices-with-all-ones/
Solution : https://youtu.be/auS1fynpnjo
There are given n ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal to sum of their lengths. We need to connect the ropes with minimum cost.
Question ID : 1107230901
Problem : https://www.codingninjas.com/studio/problems/connect-n-ropes-with-minimum-cost_625783
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.
Question ID : 1107231030
Problem : https://leetcode.com/problems/trapping-rain-water/
Solution : https://youtu.be/m18Hntz4go8
Implement a simple queue using arrays.
Question ID : 1107231133
Problem : https://www.codingninjas.com/studio/problems/implement-queue-using-arrays_8390825
Solution : https://youtu.be/M6GnoUDpqEE
Implement a Stack Data Structure specifically to store integer data using two Queues.
Question ID : 1107231146
Problem : https://www.codingninjas.com/studio/problems/stack-using-queue_795152
Solution : https://youtu.be/jDZQKzEtbYQ
Print the Next Greater Element(NGE) for every element.
Question ID : 1107231407
Problem : https://www.codingninjas.com/studio/problems/next-greater-element_670312
Solution : https://youtu.be/Du881K7Jtk8
return a array of ans, where ans[i] = no of greater elements to the right of arr[i]
Question ID : 1107231428
Problem : https://www.codingninjas.com/studio/problems/count-of-greater-elements-to-the-right_8365436
For each element of the given array, its absolute value denotes the size of that asteroid, and its sign denotes the direction it moves in(+ve meaning right and -ve meaning left). 0 means moving left.
Whenever two asteroids collide, the smaller asteroid gets destroyed.If both asteroids are the same size, then both asteroids get destroyed. Two asteroids moving in the same direction never collide.
You are supposed to find the state of the asteroids after all collisions.
Question ID : 1107231514
Problem : https://www.codingninjas.com/studio/problems/asteroid-collision_977232
let x be the minimum element of any contiguous subarray of ‘arr’.You need to return the sum of 'X' over all the contiguous subarrays of 'arr'.
Question ID : 1107231639
Problem : https://www.codingninjas.com/studio/problems/sum-of-subarray-minimums_8365431
Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.
Question ID : 1107231927
Problem : https://leetcode.com/problems/lru-cache
Solution : https://youtu.be/xDEuM5qa0zg
Design and implement a data structure for a Least Frequently Used (LFU) cache.
Question ID : 1207230801
Problem : https://leetcode.com/problems/lfu-cache/
Solution : https://youtu.be/0PSB9y8ehbk
There are ‘N’ people at a party. Each person has been assigned a unique id between 0 to 'N' - 1(both inclusive). A celebrity is a person who is known to everyone but does not know anyone at the party.
Question ID : 1207231142
Problem : https://www.codingninjas.com/studio/problems/the-celebrity-problem_982769
Given a string s, find the length of the longest substring without repeating characters.
Question ID : 1207231206
Problem : https://leetcode.com/problems/longest-substring-without-repeating-characters
Solution : https://youtu.be/qtVh-XEpsJo
You are given a string 'str' and an integer ‘K’. Your task is to find the length of the largest substring with at most ‘K’ distinct characters.
Question ID : 1207231219
You are given an array ‘ARR’ having ‘N’ integers. You are also given an integer ‘K’. The task is to count the number of subarrays that have at most ‘K’ distinct values.
Question ID : 1207231225
You are given a string s and an integer k. You can choose any character of the string and change it to any other uppercase English character. You can perform this operation at most k times.
Return the length of the longest substring containing the same letter you can get after performing the above operations.
Question ID : 1207231310
Problem : https://leetcode.com/problems/longest-repeating-character-replacement
Given a binary array nums and an integer goal, return the number of non-empty subarrays with a sum goal.
Question ID : 1207231341
Problem : https://leetcode.com/problems/binary-subarrays-with-sum
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
Question ID : 1207231459
Problem : https://leetcode.com/problems/min-stack/
Solution : https://youtu.be/V09NfaGf2ao
Implement a queue data structure which follows FIFO(First In First Out) property, using only the instances of the stack data structure.
Question ID : 1207231533
Problem : https://www.codingninjas.com/studio/problems/day-25-:-queue-using-stack_799482
Solution : https://youtu.be/3Et9MrMc02A
Convert the given infix expression to postfix expression.
Question ID : 1307230817
Problem : https://www.codingninjas.com/studio/problems/day-23-:-infix-to-postfix-_1382146
Solution : https://youtu.be/mg9yi6YuAVk
Given an infix expression, Your task is to convert the given infix expression to a prefix expression.
Question ID : 1307230833
Solution : https://takeuforward.org/data-structure/infix-to-prefix/
Convert postfix expression to infix notation.
Question ID : 1307230911
Problem : https://www.codingninjas.com/studio/problems/postfix-to-infix_8382386
Solution : https://youtu.be/MuF5p8-oWc8
Convert prefix expression to infix notation.
Question ID : 1307231018
Problem : https://www.codingninjas.com/studio/problems/prefix-to-infix_1215000
Solution : https://youtu.be/5B6jw4wOJR0
You are given a string ‘S’, an infix expression that has operands, operators and parentheses ‘(‘ and ‘)’.
You need to return the binary expression tree, whose inorder traversal is the same as ‘S’.
Question ID : 1307231155
Trie / 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.
Question ID : 1307231417
Problem : https://leetcode.com/problems/implement-trie-prefix-tree/
Solution : https://youtu.be/dBGUmUQhjaM
Implement a data structure ”TRIE” from scratch.
insert(“WORD”)
countWordsEqualTo(“WORD”)
countWordsStartingWith(“PREFIX”)
erase(“WORD”)
Question ID : 1307231513
Problem : https://www.codingninjas.com/studio/problems/implement-trie_1387095
Solution : https://youtu.be/K5pcpkEMCN0
A string is called a complete string if every prefix of this string is also present in the array ‘A’. Ninja is challenged to find the longest complete string in the array ‘A’.If there are multiple strings with the same length, return the lexicographically smallest one and if no string exists, return "None".
Question ID : 1307231552
Problem : https://www.codingninjas.com/studio/problems/complete-string_2687860
Solution : https://youtu.be/AWnBa91lThI
Given a string 'S', you are supposed to return the number of distinct substrings(including empty substring) of the given string. You should implement the program using a trie.
Question ID : 1307231647
Problem : https://www.codingninjas.com/studio/problems/count-distinct-substrings_985292
Solution : https://youtu.be/RV0QeTyHZxo
Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order.
Question ID : 1307232027
Problem : https://leetcode.com/problems/permutations
Solution : https://youtu.be/f2ic2Rsc9pU
You will be given three functions , getXOR , getBit, setBit
Question ID : 1307230811
Problem : https://www.codingninjas.com/studio/problems/bitwise-basic-operations_8382552
Solution : https://youtu.be/5iyuU4hQFrw
The problem is to find the rightmost bit of a non-negative number 'N' that is currently unset (i.e., has a value of 0) in its binary representation and set it to 1.
Question ID : 1307231013
Problem : https://www.codingninjas.com/studio/problems/set-the-rightmost-unset-bit_8160456
Given two integers start and goal, return the minimum number of bit flips to convert start to goal.
Question ID : 1307231153
Problem : https://www.codingninjas.com/studio/problems/flip-bits_8160405
Given a collection of numbers, nums, that might contain duplicates, return all possible unique permutations in any order.
Question ID : 1307231354
Problem : https://leetcode.com/problems/permutations-ii
Given an array of integers nums, sort the array in ascending order and return it.
Question ID : 1607231006
Problem : https://leetcode.com/problems/sort-an-array/
Solution : https://youtu.be/MMTQz-G8e-I
You are given a parentheses string s. In one move, you can insert a parenthesis at any position of the string.Return the minimum number of moves required to make s valid.
Question ID : 1607231020
Problem : https://leetcode.com/problems/minimum-add-to-make-parentheses-valid
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.)
Question ID : 1607231039
Problem : https://leetcode.com/problems/swap-nodes-in-pairs
Given two binary strings a and b, return their sum as a binary string.
Question ID : 1607231926
Problem : https://leetcode.com/problems/add-binary
Given the head of a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.
You should preserve the original relative order of the nodes in each of the two partitions.
Question ID : 1607232013
Problem : https://leetcode.com/problems/partition-list
Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane, return the maximum number of points that lie on the same straight line.
Question ID : 1707230839
Problem : https://leetcode.com/problems/max-points-on-a-line/
Question ID : 2507231142
Problem : https://leetcode.com/problems/find-median-from-data-stream
Solution : https://youtu.be/EcNbRjEcb14
You are given an m x n matrix maze with empty cells (represented as '.') and walls (represented as '+'). You are also given the entrance of the maze.
An exit is defined as an empty cell that is at the border of the maze.
Return the number of steps in the shortest path from the entrance to the nearest exit, or -1 if no such path exists.
Question ID : 2507231431
You are given an array of events where events[i] = [startDayi, endDayi]. Every event i starts at startDayi and ends at endDayi.
You can attend an event i at any day d where startTimei ≤ d ≤ endTimei. You can only attend one event at any time d.
Return the maximum number of events you can attend.
Question ID : 2607231206
Problem : https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended
Solution : https://youtu.be/ABH9cRhwmlg
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.
Question ID : 2707231004
Problem : https://leetcode.com/problems/longest-increasing-path-in-a-matrix
There are n rooms 0 to n - 1.
You are given a array meetings will be held during the half-closed time interval [starti, endi).
Each meeting will take place in the unused room with the lowest number.
If there are no available rooms, the meeting will be delayed until a room becomes free. The delayed meeting should have the same duration as the original meeting.
When a room becomes unused, meetings that have an earlier original start time should be given the room.
Return the number of the room that held the most meetings. If there are multiple rooms, return the room with the lowest number
Question ID : 2607231136
Problem : https://leetcode.com/problems/meeting-rooms-iii
Hardness :
Topic :
ALL Sorting Arrays LinkedList Binary Search Strings Recursion Stack - Queue Greedy Trees BST Graphs DP window Grid Tries Bitssolution :
SYNTAX.c++ OOPS.c++ DSA.c++ COLD.c++