![shashCode](/img/default-banner.jpg)
- Видео 480
- Просмотров 1 014 835
shashCode
Индия
Добавлен 17 май 2011
Hi I am Shashwat Tiwari, software engineer at Samsung Research. I enjoy solving problems using coding and other computer science stuff. This channel is for sharing knowledge on programming, computer science fundamentals, data structures and algorithms, and a lot more with touch of motivational talks. You can get free courses, learn how to code, how to start programming, how to prepare for Interviews and everything in between.
Learn to develop in hindi
Learn to code in hindi
Btw Hindi is my language , programming language could be java, python, c++, javascipt, go lang.
Feel free to dm me whenever you want: linktr.ee/shashwat_tiwari_st
Learn to develop in hindi
Learn to code in hindi
Btw Hindi is my language , programming language could be java, python, c++, javascipt, go lang.
Feel free to dm me whenever you want: linktr.ee/shashwat_tiwari_st
2096. Step-By-Step Directions From a Binary Tree Node to Another | Leetcode POTD | DSA | Hindi
(Please watch LCA, before watching this video)
LCA:
ruclips.net/video/m9NKcTvrhSc/видео.htmlsi=OfyrA2JwaGu02vls
Problem Name:
2196. Create Binary Tree From Descriptions
Problem Statement:
You are given the root of a binary tree with n nodes. Each node is uniquely assigned a value from 1 to n. You are also given an integer startValue representing the value of the start node s, and a different integer destValue representing the value of the destination node t.
Find the shortest path starting from node s and ending at node t. Generate step-by-step directions of such path as a string consisting of only the uppercase letters 'L', 'R', and 'U'. Each letter indicates a specific direction:
'L' means to g...
LCA:
ruclips.net/video/m9NKcTvrhSc/видео.htmlsi=OfyrA2JwaGu02vls
Problem Name:
2196. Create Binary Tree From Descriptions
Problem Statement:
You are given the root of a binary tree with n nodes. Each node is uniquely assigned a value from 1 to n. You are also given an integer startValue representing the value of the start node s, and a different integer destValue representing the value of the destination node t.
Find the shortest path starting from node s and ending at node t. Generate step-by-step directions of such path as a string consisting of only the uppercase letters 'L', 'R', and 'U'. Each letter indicates a specific direction:
'L' means to g...
Просмотров: 144
Видео
Lecture-9 126. Word Ladder 2 | GFG | leetcode | Graph Traversal | Graph Series | DSA | Hindi
Просмотров 6620 часов назад
Problem Name: 127. Word Ladder Problem Statement: A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord - s1 - s2 - ... - sk such that: Every adjacent pair of words differs by a single letter. Every si for 1 = i = k is in wordList. Note that beginWord does not need to be in wordList. sk endWord Given two words, beginWord and e...
2196. Create Binary Tree From Descriptions | Trees | Leetcode Daily Challenge | DSA | Hindi
Просмотров 1,6 тыс.2 часа назад
Problem Name: 2196. Create Binary Tree From Descriptions Problem Statement: You are given a 2D integer array descriptions where descriptions[i] = [parenti, childi, isLefti] indicates that parenti is the parent of childi in a binary tree of unique values. Furthermore, If isLefti 1, then childi is the left child of parenti. If isLefti 0, then childi is the right child of parenti. Construct the bi...
726. Number of Atoms | Stacks | Leetcode Daily Challlenge | DSA | Hindi
Просмотров 1,8 тыс.4 часа назад
Problem Name: 726. Number of Atoms Problem Statement: Given a string formula representing a chemical formula, return the count of each atom. The atomic element always starts with an uppercase character, then zero or more lowercase letters, representing the name. One or more digits representing that element's count may follow if the count is greater than 1. If the count is 1, no digits will foll...
2751. Robot Collisions | Stacks | Leetcode Daily Challlenge | DSA | Hindi
Просмотров 1,8 тыс.4 часа назад
Problem Name: 2751. Robot Collisions Problem Statement: There are n 1-indexed robots, each having a position on a line, health, and movement direction. You are given 0-indexed integer arrays positions, healths, and a string directions (directions[i] is either 'L' for left or 'R' for right). All integers in positions are unique. All robots start moving on the line simultaneously at the same spee...
1717. Maximum Score From Removing Substrings | Leetcode Daily Challenge | DSA | Hindi
Просмотров 1,9 тыс.7 часов назад
Problem Name: 1717. Maximum Score From Removing Substrings Problem Statement: You are given a string s and two integers x and y. You can perform two types of operations any number of times. Remove substring "ab" and gain x points. For example, when removing "ab" from "cabxbae" it becomes "cxbae". Remove substring "ba" and gain y points. For example, when removing "ba" from "cabxbae" it becomes ...
1190. Reverse Substrings Between Each Pair of Parentheses | Leetcode Daily Challlenge | DSA | Hindi
Просмотров 2 тыс.12 часов назад
Problem Name: 1190. Reverse Substrings Between Each Pair of Parentheses Problem Statement: You are given a string s that consists of lower case English letters and brackets. Reverse the strings in each pair of matching parentheses, starting from the innermost one. Your result should not contain any brackets. Problem Link: leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses...
Lecture-8 127. Word Ladder | Graph Traversal | Graph Series | DSA | Hindi
Просмотров 22412 часов назад
Problem Name: 127. Word Ladder Problem Statement: A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord - s1 - s2 - ... - sk such that: Every adjacent pair of words differs by a single letter. Every si for 1 = i = k is in wordList. Note that beginWord does not need to be in wordList. sk endWord Given two words, beginWord and e...
1598. Crawler Log Folder | Leetcode Daily Challlenge | tree levels | DSA | Java | Hindi
Просмотров 1,5 тыс.14 часов назад
Problem Name: 1598. Crawler Log Folder Problem Statement: The Leetcode file system keeps a log each time some user performs a change folder operation. The operations are described below: "../" : Move to the parent folder of the current folder. (If you are already in the main folder, remain in the same folder). "./" : Remain in the same folder. "x/" : Move to the child folder named x (This folde...
Lecture-7 200. Number of Islands | Graph Traversal | Graph Series | DSA | Hindi
Просмотров 14214 часов назад
Problem Name: 200. Number of Islands Problem Statement: Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water. Problem Link: leetcode.com/problems/number-of...
1701. Average Waiting Time | Leetcode Daily Challlenge | Arrays | DSA | Hindi
Просмотров 2 тыс.16 часов назад
Problem Name: 1701. Average Waiting Time Problem Statement: There is a restaurant with a single chef. You are given an array customers, where customers[i] = [arrivali, timei]: arrivali is the arrival time of the ith customer. The arrival times are sorted in non-decreasing order. timei is the time needed to prepare the order of the ith customer. When a customer arrives, he gives the chef his ord...
Lecture-6 733. Flood Fill using BFS and DFS | Graph Traversal | Graph Series | DSA | Hindi
Просмотров 15116 часов назад
Problem Name: 733. Flood Fill Problem Statement: An image is represented by an m x n integer grid image where image[i][j] represents the pixel value of the image. You are also given three integers sr, sc, and color. You should perform a flood fill on the image starting from the pixel image[sr][sc]. To perform a flood fill, consider the starting pixel, plus any pixels connected 4-directionally t...
1823. Find the Winner of the Circular Game | Leetcode Daily Challlenge | Maths | DSA | Hindi
Просмотров 1,8 тыс.19 часов назад
Problem Name: 1823. Find the Winner of the Circular Game Problem Statement: There are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n in clockwise order. More formally, moving clockwise from the ith friend brings you to the (i 1)th friend for 1 = i n, and moving clockwise from the nth friend brings you to the 1st friend. The rules of the game ...
1518. Water Bottles | Maths | leetcode daily challenge | DSA | Hindi
Просмотров 1,7 тыс.21 час назад
Problem Name: 1518. Water Bottles Problem Statement: There are numBottles water bottles that are initially full of water. You can exchange numExchange empty water bottles from the market with one full water bottle. The operation of drinking a full water bottle turns it into an empty bottle. Given the two integers numBottles and numExchange, return the maximum number of water bottles you can dri...
2582. Pass the Pillow | Maths | leetcode daily challenge | DSA | Hindi
Просмотров 1,9 тыс.День назад
Problem Name: 2582. Pass the Pillow Problem Statement: There are n people standing in a line labeled from 1 to n. The first person in the line is holding a pillow initially. Every second, the person holding the pillow passes it to the next person standing in the line. Once the pillow reaches the end of the line, the direction changes, and people continue passing the pillow in the opposite direc...
Lecture-5 Breadth First Search | BFS | Graph Traversal | Graph Series | DSA | Hindi
Просмотров 175День назад
Lecture-5 Breadth First Search | BFS | Graph Traversal | Graph Series | DSA | Hindi
2058. Find the Minimum and Maximum Number of Nodes Between Critical Points | DSA | Hindi
Просмотров 1,3 тыс.День назад
2058. Find the Minimum and Maximum Number of Nodes Between Critical Points | DSA | Hindi
Lecture-4 Depth First Search in Graph | DFS | Graph Traversal | Graph Series | DSA | Hindi | GFG
Просмотров 195День назад
Lecture-4 Depth First Search in Graph | DFS | Graph Traversal | Graph Series | DSA | Hindi | GFG
2181. Merge Nodes in Between Zeros Leetcode daily challenge | DSA | Hindi
Просмотров 1,3 тыс.День назад
2181. Merge Nodes in Between Zeros Leetcode daily challenge | DSA | Hindi
Lecture-3 Path | Cycle | DAG | Components Traversal | Graph Series | DSA | Hindi
Просмотров 161День назад
Lecture-3 Path | Cycle | DAG | Components Traversal | Graph Series | DSA | Hindi
1509. Minimum Difference Between Largest and Smallest Value in Three Moves Leetcode daily challenge
Просмотров 2,9 тыс.День назад
1509. Minimum Difference Between Largest and Smallest Value in Three Moves Leetcode daily challenge
Lecture-2 Graph Representation and Application | Graph Series | DSA | Hindi
Просмотров 429День назад
Lecture-2 Graph Representation and Application | Graph Series | DSA | Hindi
350. Intersection of Two Arrays II | hashing | leetcode daily challenge | DSA | Hindi
Просмотров 1,6 тыс.14 дней назад
350. Intersection of Two Arrays II | hashing | leetcode daily challenge | DSA | Hindi
Lecture-1 Introduction to Graphs | Graph Series | DSA | Hindi
Просмотров 61914 дней назад
Lecture-1 Introduction to Graphs | Graph Series | DSA | Hindi
1550. Three Consecutive Odds | linear search | sliding window | leetcode daily challenge | Hindi
Просмотров 1,2 тыс.14 дней назад
1550. Three Consecutive Odds | linear search | sliding window | leetcode daily challenge | Hindi
DSUs | Disjoint Sets in one shot | graph | leetcode daily challenge | DSA | Hindi
Просмотров 41314 дней назад
DSUs | Disjoint Sets in one shot | graph | leetcode daily challenge | DSA | Hindi
1579. Remove Max Number of Edges to Keep Graph Fully Traversable | graph | leetcode daily | Hindi
Просмотров 59314 дней назад
1579. Remove Max Number of Edges to Keep Graph Fully Traversable | graph | leetcode daily | Hindi
2192. All Ancestors of a Node in a Directed Acyclic Graph | graph | leetcode daily challenge | Hindi
Просмотров 76814 дней назад
2192. All Ancestors of a Node in a Directed Acyclic Graph | graph | leetcode daily challenge | Hindi
2285. Maximum Total Importance of Roads | graph | leetcode daily challenge | DSA | Hindi
Просмотров 1,3 тыс.14 дней назад
2285. Maximum Total Importance of Roads | graph | leetcode daily challenge | DSA | Hindi
1791. Find Center of Star Graph | graph | leetcode daily challenge | DSA | Hindi
Просмотров 80714 дней назад
1791. Find Center of Star Graph | graph | leetcode daily challenge | DSA | Hindi
Can you join source code with it. As github repo or ss.
Amazing and clear explanation as always
love from colombia❤
World tour 🙌
22:43 If anyone is thinking about the edge case where one of the target node is the ancestor... for cases where lca(p,q) = p or lca(p,q) = q. Path of one of the node will be "commonPath" and Path of second node will be "commonPath" + "some additional moves". Example: let's say p is the ancestor node. That means ancestor(p,q) = p. path from root to p is "LLRRLR" path from root to q is "LLRRLRLLRR" Now as you can see path of p is actually the prefix of path of q. Still our logic remains same, replace path of p with. "U" and add leftover path of q. So output will be "UUUUUULLRR".
Started new journey
😍😍😍
Please watch LCA before watching this video. Do like the video, if you understood the solution. Like target for this video is 100. ☺☺ ruclips.net/video/m9NKcTvrhSc/видео.html
Nice
thank you sir.
Thanks 😊
Huge Inspiration !! Please keep continuing.. I am an international student here in USA. I am highly benefited from your videos !!
osm explain
❤❤❤
Thank you sir.
bro description is a 2-d array so iterating it should take O(n^2) . isn't it?
Each element among n elements has 3 elements. So total traversal complexity is O(3*n) = O(n). It would have been n^2 if each element had n elements
OMG this sol is great.Its so compact.Thank you so much.Also thankyou for doing it in java.Everyone does it in C++ and myself being only one doing DSA/CP in java...I struggle to find sol on youtube.Thank you so much!
cp wale bhi solution search krte hai
Thanks 😊
Animal ek class and dog,cat, monkey these are objects
we are returning only root then how all others elements are printed ? can you explain please
@@Smarty_329 If you read the problem description, it is given that we only have to return the root of the new tree formed. They will traverse and check if it is correct or not (level order traversal). If you want to check, you can apply level order traversal and verify with outputs given in sample test cases..
Today 15 July 2024 i'll start the playlist.
Keep Going 👌👌
Thanks bhaiya 🙏
Bhaiya ye wala lecture bahut complex hai samajh me nhi aaraha....
If you have understood the explanation, please do like the video 😊. Like target for this video is 90
Kya aap ek video main yeh bata sakte ho ki how younthink of a solution and how much actual time you take it would be helpfull
gjb explain sir
Sir what is the space complexity?
@@arneshbasak1910 stack of map. N^2
love from china❤
Bhai kal Spain ajj china 😂
first
Best explanation!
[1] Vegetables = class, Aloo, bhindi, Gajar=Objects, [2] Sweets=class, Kaju Katli, balMithai, rasgula, gulabjamun = objects :)
Great
Thank you for explaining, i actually code in c++, i came here know the concept & implementation... and you save me♥♥
Please do like, if you understood 😊. Like target for this video is 90
very nice explanantion sir,Thankyou
❤❤❤
Thanks 😊
bhai khatranaak mza aagya
wow what a content. Thank you so much sir❤❤❤❤
bhaiya mana ya code c++ ma kiya to some test case pass ne ho ra ?..
love from spain♥
Whaa ka newspaper sach me cloth pe print hote hai ya rumour hai .
Respect for all those who came here after seeing the chemistry in a leet code question! Only Shashwat bhai can save us!
What is the TC
shayad o(n)
hi, TC will be O(N^2). N for string iteration and N for iterating the map.
Sir wo remove substring "ab" and "ba" to get max point question ke video pe doubt comment Kiya haii.. Please sir solve krdo
okay mai debug krke btata hu
@@shashwat_tiwari_st Yes sir plz batao
the best part is , you helping us think organically, thank you so much
kuch smaj nahi aa raha haii
Can you please take up the Leetcode 146. LRU Cache problem to explain in a video?
Great you gained a sub
not working for second case
You might have missed something, check your code once more.
We don't have to push any left moving robot to the stack. Also, We can just check at the start of the while loop that if the health of the left moving robot becomes 0 then we break out of the while loop.
@@PiyushYadav-pl9jm That makes sense, I guess no changes in TC but it will reduce a few lines of code for sure.
@shashwat_tiwari_st yeah, and thanks, btw
Sir please update your version Yup study model like 1990s Git gaakar r1 r2 r3 bol rhe ho ye kya tarika hai
@@navneetsingh7209 thoda smjh me aaye aesa bolo...!