- 159
- 23 305
ak tiwari
India
Приєднався 27 вер 2020
CodeChef Starters 164 | Swap and Flip | Solution
CodeChef Starters 164 | Swap and Flip | Solution
Переглядів: 1 079
Відео
Leetcode weekly contest 427 | Transformed Array | Solution
Переглядів 25812 годин тому
Leetcode weekly contest 427 | Transformed Array | Solution
Leetcode Biweekly contest 145 | Minimum Operations to Make Array Values Equal to K | Solution
Переглядів 1,2 тис.14 годин тому
Leetcode Biweekly contest 145 | Minimum Operations to Make Array Values Equal to K | Solution
52 Blind 75 | Reorder List | Explanation cpp
Переглядів 14День тому
52 Blind 75 | Reorder List | Explanation cpp
Leetcode Weekly 246 | Identify the Largest Outlier in an Array | Explanation | cpp
Переглядів 29День тому
Leetcode Weekly 246 | Identify the Largest Outlier in an Array | Explanation | cpp
Leetcode weekly 426 | Smallest Number With All Set Bits | Explanation
Переглядів 23День тому
Leetcode weekly 426 | Smallest Number With All Set Bits | Explanation
Leetcode weekly contest 426 | Smallest Number With All Set Bits | Solution
Переглядів 253День тому
Leetcode weekly contest 426 | Smallest Number With All Set Bits | Solution
Codechef Starters 161 | One To Three | Explanation
Переглядів 11621 день тому
Codechef Starters 161 | One To Three | Explanation
Codechef Starters 161 | One To Three | Solution
Переглядів 29121 день тому
Codechef Starters 161 | One To Three | Solution
Codechef Starters 161 | Two Cards | Explanation
Переглядів 40121 день тому
Codechef Starters 161 | Two Cards | Explanation
Codechef Starters 161 | Two Cards | Solution
Переглядів 73321 день тому
Codechef Starters 161 | Two Cards | Solution
Leetcode weekly contest 424 | Zero Array Transformation I | Explanation
Переглядів 28621 день тому
Leetcode weekly contest 424 | Zero Array Transformation I | Explanation
Leetcode weekly contest 424 | Zero Array Transformation I | Solution
Переглядів 54521 день тому
Leetcode weekly contest 424 | Zero Array Transformation I | Solution
42 Blind75 | Non-overlapping Intervals
Переглядів 328 днів тому
42 Blind75 | Non-overlapping Intervals
39 Blind75 | Longest Consecutive Sequence | Explanation
Переглядів 7Місяць тому
39 Blind75 | Longest Consecutive Sequence | Explanation
38 Blind75 | Number of Islands | Explanation with DFS
Переглядів 3Місяць тому
38 Blind75 | Number of Islands | Explanation with DFS
37 Blind 75 | Pacific Atlantic Water Flow
Переглядів 5Місяць тому
37 Blind 75 | Pacific Atlantic Water Flow
36 Blind 75 | Course Schedule | Explained with BFS & DFS
Переглядів 17Місяць тому
36 Blind 75 | Course Schedule | Explained with BFS & DFS
bro please upload hallowen array solution
Thanks Akash, Its helpful:D
My pleasure 😊
code
2nd solution please
ua-cam.com/video/IUsAc58h0lI/v-deo.html
Temporary Temperature plese make this solustion
does this not take more than n^2 time
did this work in time?
yes
Explanation - ua-cam.com/video/r0CKXtVofrI/v-deo.html
Explanation - ua-cam.com/video/456BT4IIKIk/v-deo.html
code ka link de do
Great explanation
Glad you think so!
class Solution { public: bool isZeroArray(vector<int>& nums, vector<vector<int>>& queries) { int n = queries.size(); for (int i = 0; i < n; i++) { int l = queries[i][0]; int r = queries[i][1]; for (int p = l; p <= r; p++) { if(nums[p]==0) { continue; } nums[p]--; } } for (int i = 0; i < nums.size(); i++) { if (nums[i] != 0) { return false; } } return true; } }; why showing tle in last two cases meanwhile same code this is that you write
I optimised this code later in the video
Encountered Such type of Problem for the First time. Thank You for The Great Explaination. I did through Brute Force O(m*n) and Encountered TLE. A small doubt, How did you come up with this solution? Like I mean did you solve similar concept problems prior?
Thanks for the appreciation! intuition develops naturally when you solve a variety of problems over time
Can you please explain how the diff[si] - - and diff[ei+1] + + helped here? The logic behind doing this is still unclear😅
sure.... see diff[si]-- is marking the start of a query and diff[ei+1]++ is marking the end of the same query in diff after doing this for all queries we have accumulated information from all the queries in diff array
Explanation- ua-cam.com/video/eE_-c6YnfVQ/v-deo.html
Great explanation , can you suggest some sources to read more about cumulative sum?
Thanks for the appreciation! Try prefix sum and suffix sum problems for better understanding
@@aktiwari2any sources or articles?
code
Helpful, Thanks for the explanation.
You're welcome!
Nice Explanation
Keep watching
code
wrong
bro explaination pls
Thanks, It's helpful
You're welcome
Great explanation
Thanks ☺️
It's helpful, Thanks:)
Glad it helped! :)
Tiwari ji, well explained
Well Explained⚡
Thanks 😀
4th question ans is available?
Nice and Clear Solution Understand it within 3 min THx
Thanks
i solve 2nd using priority queue class Solution { public: #define p pair<ll, pair<ll, ll>> #define ll long long long long minNumberOfSeconds(int mountainHeight, vector<int>& workerTimes) { ll ans=0; priority_queue<p, vector<p>, greater<p>>pq; for(auto it : workerTimes){ pq.push({it, {1, it}}); } while(!pq.empty() && mountainHeight){ p top = pq.top(); pq.pop(); // Manually extract the pair ll val = top.first; ll level = top.second.first; ll mul = top.second.second; ans = max(ans, (ll)val); pq.push({val + (level + 1) * mul, {level + 1, mul}}); mountainHeight--; } return ans; } };
bhai 2nd and 3rd ki explaination details me batana step wise
yes
send me code bro
Thnx man keep uploading contest answers helps a lot! Also clear voice mei bolo bina hesitation ke impact acha aata h❤
what is the intuition for this particular problem
Have you solved similar problem before, I was not able to think of this solution.
yes I had seen a similar problem before
@aktwari2 bro can you please provide me list of questions with same pattern.
mai to bhai isme Dynamic programming lgga rha tha
bhai iss question ki maine 3-4 lagah explaination dekhi abb jaa kr samajh me aaya thanks bhaiya
Welcome
thanks very easy explanation
Welcome
First viewer🫣🙋
Thanks for being the first to watch! You're awesome! 🎉🙌
I think you not understand question , I tell you , If i am wrong correct me, In question at any point of time we reaches to alice , alice can move N steps let suppose alice wants to move R R R D D but when he travelled R R R and bob catch in this position than it is also correct. as per my understanding if he is able to catch on any step<=N Bob win and I think you are talking about after completing N steps , bob can reach or not.
yes u are correct ........I missed this point.
@@aktiwari2 no problem bro , great start keep going
@@aktiwari2 one observation from your channel , I think you don't need to add thumbnail (you can see previous videos you are getting more views without thumbnail) i don't know why , it can be one of attraction for learner , keep going keep learning
Bro if you make a full contest solution video it would be really grt help🙏
I really appreciate the effort you put into breaking down the information in such an understandable way.✨
So glad you liked it! 😊
Nice explanation ✨
Thank you! 😃
q3 and a4 plz brother
q2?? bro
Nice explanation:))
Thanks! 😃
It's helpful, thanks Ak👍🏻
You're welcome 😊
voice is not louder
bro first two are very easy. Pls make solution videos for next two...
good
bro kahase sikha apne please guide us
chat gpt se cheepa
@@King_96969maine bhi try kiya but galat answers hi aaye