- 67
- 15 061
Jeevesh Rai
เข้าร่วมเมื่อ 21 ก.ค. 2024
Welcome to our channel !
We offer daily programming concepts from DSA to full-stack development, including in-depth tutorials on frontend and backend development with practical examples. Join us to enhance your coding skills, stay updated on the latest in app development, and connect with a community of like-minded developers.
Subscribe for regular updates and exclusive content. Let's code together! 🚀
We offer daily programming concepts from DSA to full-stack development, including in-depth tutorials on frontend and backend development with practical examples. Join us to enhance your coding skills, stay updated on the latest in app development, and connect with a community of like-minded developers.
Subscribe for regular updates and exclusive content. Let's code together! 🚀
3043. Find the Length of the Longest Common Prefix | Leetcode POTD Explained
🎥 Welcome to Our Coding Channel! 🚀
In this video, we dive deep into an intriguing coding challenge: Find the Length of the Longest Common Prefix ! 🎯
⏱ TIMESTAMPS
🎯 Objective:
In this video, we'll tackle a unique problem where we need to find the length of the Longest Common Prefix between pairs of integers from two arrays. We'll explore how prefixes work, dive deep into the C++ implementation, and uncover the logic behind solving this intriguing challenge!
💡 Concepts Covered:
- Understanding Prefixes in Integers 🔢
- Using Unordered Sets for Prefix Matching 📋
- Efficient String Manipulation in C++ ✂️
- Step-by-step Debugging and Optimization 🛠️
📈 What You'll Learn:
By the end of this video, you'll master how to approach problems involving prefixes, efficiently compare large datasets, and optimize your code for better performance. This problem is perfect for those looking to sharpen their competitive programming skills! 🏆
🔗 Problem Statement: leetcode.com/problems/find-the-length-of-the-longest-common-prefix/
🔗 Source Code: github.com/Jeevesh0207/POTD/blob/main/3043.%20Find%20the%20Length%20of%20the%20Longest%20Common%20Prefix
🚀 Watch Now and Level Up Your Algorithm Skills!
💻 About Our Channel
Welcome to our channel! Here, We offer solutions to coding problems and teach programming concepts daily, covering everything from data structures and algorithms (DSA) to full-stack development. Dive into our content for in-depth tutorials on frontend and backend development, alongside practical examples and problem-solving techniques. Join us to enhance your coding skills and stay updated on the latest in app development!
Check out our channel here:
www.youtube.com/@codeby_naruto
🔔 Don’t forget to subscribe!
🎥 Check Out Our Other Videos
th-cam.com/video/U0_3vt3OAYQ/w-d-xo.html
th-cam.com/video/6NFO7xzIwI8/w-d-xo.htmlsi=hbcWEgxnLg90y283
th-cam.com/video/JFGbpTgEdvU/w-d-xo.htmlsi=EnQ-hk2ItgVzhJqq
🌐 Find Us At
Portfolio: jeeveshportfolio.netlify.app/
Github: github.com/Jeevesh0207/
Leetcode: leetcode.com/u/rabbit0207/
#3043 #potd #leetcodepotd #leetcodesolution #leetcodeblind75 #set #unorderedlist
In this video, we dive deep into an intriguing coding challenge: Find the Length of the Longest Common Prefix ! 🎯
⏱ TIMESTAMPS
🎯 Objective:
In this video, we'll tackle a unique problem where we need to find the length of the Longest Common Prefix between pairs of integers from two arrays. We'll explore how prefixes work, dive deep into the C++ implementation, and uncover the logic behind solving this intriguing challenge!
💡 Concepts Covered:
- Understanding Prefixes in Integers 🔢
- Using Unordered Sets for Prefix Matching 📋
- Efficient String Manipulation in C++ ✂️
- Step-by-step Debugging and Optimization 🛠️
📈 What You'll Learn:
By the end of this video, you'll master how to approach problems involving prefixes, efficiently compare large datasets, and optimize your code for better performance. This problem is perfect for those looking to sharpen their competitive programming skills! 🏆
🔗 Problem Statement: leetcode.com/problems/find-the-length-of-the-longest-common-prefix/
🔗 Source Code: github.com/Jeevesh0207/POTD/blob/main/3043.%20Find%20the%20Length%20of%20the%20Longest%20Common%20Prefix
🚀 Watch Now and Level Up Your Algorithm Skills!
💻 About Our Channel
Welcome to our channel! Here, We offer solutions to coding problems and teach programming concepts daily, covering everything from data structures and algorithms (DSA) to full-stack development. Dive into our content for in-depth tutorials on frontend and backend development, alongside practical examples and problem-solving techniques. Join us to enhance your coding skills and stay updated on the latest in app development!
Check out our channel here:
www.youtube.com/@codeby_naruto
🔔 Don’t forget to subscribe!
🎥 Check Out Our Other Videos
th-cam.com/video/U0_3vt3OAYQ/w-d-xo.html
th-cam.com/video/6NFO7xzIwI8/w-d-xo.htmlsi=hbcWEgxnLg90y283
th-cam.com/video/JFGbpTgEdvU/w-d-xo.htmlsi=EnQ-hk2ItgVzhJqq
🌐 Find Us At
Portfolio: jeeveshportfolio.netlify.app/
Github: github.com/Jeevesh0207/
Leetcode: leetcode.com/u/rabbit0207/
#3043 #potd #leetcodepotd #leetcodesolution #leetcodeblind75 #set #unorderedlist
มุมมอง: 188
วีดีโอ
2707. Extra Characters in a String | Leetcode POTD Explained
มุมมอง 252หลายเดือนก่อน
🎥 Welcome to Our Coding Channel! 🚀 In this video, we dive deep into an intriguing coding challenge: Extra Characters in a String! 🎯 ⏱ TIMESTAMPS 🎯 Objective: Learn how to break a 0-indexed string s into one or more non-overlapping substrings such that each substring is present in a given dictionary of words, while minimizing the number of extra characters left over. We'll implement this in C us...
440. K-th Smallest in Lexicographical Order | Leetcode POTD Explained
มุมมอง 972หลายเดือนก่อน
🎥 Welcome to Our Coding Channel! 🚀 In this video, we dive deep into an intriguing coding challenge: K-th Smallest in Lexicographical Order ! 🎯 ⏱ TIMESTAMPS 🎯 Objective: In this video, we tackle the problem of finding the kth lexicographically smallest integer within the range [1, n]. Learn how to approach this interesting challenge using C and master the concept of lexicographical ordering! 🚀 💡...
386. Lexicographical Numbers | Leetcode POTD Explained
มุมมอง 464หลายเดือนก่อน
🎥 Welcome to Our Coding Channel! 🚀 In this video, we dive deep into an intriguing coding challenge: Lexicographical Numbers ! 🎯 ⏱ TIMESTAMPS 🎯 Objective: In this video, we'll solve a unique problem: Given an integer n, return all numbers in the range [1, n] sorted in lexicographical order! 🚀 We'll explore an efficient algorithm that runs in O(n) time and uses O(1) extra space. 🧠 💡 Concepts Cove...
214. Shortest Palindrome | Leetcode POTD Explained
มุมมอง 581หลายเดือนก่อน
🎥 Welcome to Our Coding Channel! 🚀 In this video, we dive deep into an intriguing coding challenge: Shortest Palindrome ! 🎯 ⏱ TIMESTAMPS 🎯 Objective: Transform a given string into the shortest palindrome by adding characters in front of it! In this video, we'll solve this problem using a clever approach with the KMP (Knuth-Morris-Pratt) algorithm to find the longest prefix that is also a suffix...
241. Different Ways to Add Parentheses | Leetcode POTD Explained
มุมมอง 365หลายเดือนก่อน
🎥 Welcome to Our Coding Channel! 🚀 In this video, we dive deep into an intriguing coding challenge: Different Ways to Add Parentheses ! 🎯 ⏱ TIMESTAMPS 🎯 Objective: In this video, we'll dive into solving a fascinating problem: Given a string expression of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. This approac...
179. Largest Number | Leetcode POTD Explained
มุมมอง 285หลายเดือนก่อน
🎥 Welcome to Our Coding Channel! 🚀 In this video, we dive deep into an intriguing coding challenge: Largest Number ! 🎯 ⏱ TIMESTAMPS 🎯 Objective: In this video, we tackle an exciting problem: arranging a list of non-negative integers to form the largest possible number! 🚀 We'll dive into an efficient solution in C that sorts the numbers in a custom order to achieve the desired result. 💡 💡 Concep...
884. Uncommon Words from Two Sentences | Leetcode POTD Explained
มุมมอง 283หลายเดือนก่อน
🎥 Welcome to Our Coding Channel! 🚀 In this video, we dive deep into an intriguing coding challenge: Uncommon Words from Two Sentences ! 🎯 ⏱ TIMESTAMPS 🎯 Objective: In this video, we'll explore how to find uncommon words between two sentences using C code! 🚀 💡 Concepts Covered: - String manipulation in C - Using unordered_map for counting word frequency - Efficient text processing techniques 📈 W...
539. Minimum Time Difference | Leetcode POTD Explained
มุมมอง 388หลายเดือนก่อน
🎥 Welcome to Our Coding Channel! 🚀 In this video, we dive deep into an intriguing coding challenge: Minimum Time Difference ! 🎯 ⏱ TIMESTAMPS 🎯 Objective: In this video, we explore how to return the minimum minutes difference between any two time points given in a 24-hour clock format ("HH "). 🕰️ Whether you’re looking to sharpen your C skills or crack that tricky problem, this tutorial has you ...
1371. Find the Longest Substring Containing Vowels in Even Counts | Leetcode POTD Explained
มุมมอง 1.1Kหลายเดือนก่อน
🎥 Welcome to Our Coding Channel! 🚀 In this video, we dive deep into an intriguing coding challenge: Find the Longest Substring Containing Vowels in Even Counts ! 🎯 ⏱ TIMESTAMPS 🎯 Objective: In this video, we solve the problem of finding the longest substring where each vowel ('a', 'e', 'i', 'o', 'u') appears an even number of times. We use bit manipulation and hash maps in C to solve this effic...
2419. Longest Subarray With Maximum Bitwise AND | Leetcode POTD Explained
มุมมอง 152หลายเดือนก่อน
🎥 Welcome to Our Coding Channel! 🚀 In this video, we dive deep into an intriguing coding challenge: Longest Subarray With Maximum Bitwise AND ! 🎯 ⏱ TIMESTAMPS 🎯 Objective: In this video, we dive deep into solving the Longest Subarray with Maximum Bitwise AND problem using C ! Given an integer array, we'll learn how to find the length of the longest subarray where the bitwise AND of the elements...
1310. XOR Queries of a Subarray | Leetcode POTD Explained
มุมมอง 203หลายเดือนก่อน
🎥 Welcome to Our Coding Channel! 🚀 In this video, we dive deep into an intriguing coding challenge: XOR Queries of a Subarray ! 🎯 ⏱ TIMESTAMPS 🎯 Objective: Learn how to efficiently compute the XOR of elements between specified indices using C ! We dive into solving a problem where you're given an array of positive integers and a set of queries. For each query, you'll find the XOR of elements be...
1684. Count the Number of Consistent Strings | Leetcode POTD Explained
มุมมอง 99หลายเดือนก่อน
🎥 Welcome to Our Coding Channel! 🚀 In this video, we dive deep into an intriguing coding challenge: Count the Number of Consistent Strings ! 🎯 ⏱ TIMESTAMPS 🎯 Objective: In this video, we'll solve the problem of counting consistent strings from an array of strings. A string is considered consistent if all its characters are present in a given string of allowed distinct characters. 💡 Concepts Cov...
2220. Minimum Bit Flips to Convert Number | Leetcode POTD Explained
มุมมอง 65หลายเดือนก่อน
🎥 Welcome to Our Coding Channel! 🚀 In this video, we dive deep into an intriguing coding challenge: Minimum Bit Flips to Convert Number ! 🎯 ⏱ TIMESTAMPS 🎯 Objective: In this video, we explore how to determine the minimum number of bit flips needed to convert one integer to another using C . 🚀 💡 Concepts Covered: - XOR operation for comparison - Binary representation of numbers - Efficient bit m...
2807. Insert GCD in Linked List | Leetcode POTD Explained
มุมมอง 58หลายเดือนก่อน
🎥 Welcome to Our Coding Channel! 🚀 In this video, we dive deep into an intriguing coding challenge: Insert Greatest Common Divisors in Linked List ! 🎯 ⏱ TIMESTAMPS 🎯 Objective: In this video, we'll explore how to insert nodes into a linked list with values equal to the greatest common divisor (GCD) between every pair of adjacent nodes, using C ! 💻 💡 Concepts Covered: - Linked list traversal 📜 -...
2326. Spiral Matrix IV | Leetcode POTD Explained
มุมมอง 112หลายเดือนก่อน
2326. Spiral Matrix IV | Leetcode POTD Explained
725. Split Linked List in Parts | Leetcode POTD Explained
มุมมอง 108หลายเดือนก่อน
725. Split Linked List in Parts | Leetcode POTD Explained
1367. Linked List in Binary Tree | Leetcode POTD Explained
มุมมอง 161หลายเดือนก่อน
1367. Linked List in Binary Tree | Leetcode POTD Explained
3217. Delete Nodes From Linked List Present in Array | Leetcode POTD Explained
มุมมอง 70หลายเดือนก่อน
3217. Delete Nodes From Linked List Present in Array | Leetcode POTD Explained
2028. Find Missing Observations | Leetcode POTD Explained
มุมมอง 1632 หลายเดือนก่อน
2028. Find Missing Observations | Leetcode POTD Explained
874. Walking Robot Simulation | Leetcode POTD Explained
มุมมอง 3952 หลายเดือนก่อน
874. Walking Robot Simulation | Leetcode POTD Explained
1945. Sum of Digits of String After Convert | Leetcode POTD Explained
มุมมอง 1902 หลายเดือนก่อน
1945. Sum of Digits of String After Convert | Leetcode POTD Explained
2022. Convert 1D Array Into 2D Array | Leetcode POTD Explained
มุมมอง 682 หลายเดือนก่อน
2022. Convert 1D Array Into 2D Array | Leetcode POTD Explained
1514. Path with Maximum Probability | BFS | DFS | Leetcode POTD Explained
มุมมอง 812 หลายเดือนก่อน
1514. Path with Maximum Probability | BFS | DFS | Leetcode POTD Explained
2699. Modify Graph Edge Weights | Dijkstra's algorithm | Leetcode POTD Explained
มุมมอง 1.1K2 หลายเดือนก่อน
2699. Modify Graph Edge Weights | Dijkstra's algorithm | Leetcode POTD Explained
Find length of Loop | Floyd's Cycle Detection | GFG POTD Explained
มุมมอง 552 หลายเดือนก่อน
Find length of Loop | Floyd's Cycle Detection | GFG POTD Explained
947. Most Stones Removed | BFS | DFS | Leetcode POTD Explained
มุมมอง 1702 หลายเดือนก่อน
947. Most Stones Removed | BFS | DFS | Leetcode POTD Explained
Leetcode 1905. Count Sub Islands | BFS | DFS | Potd Explained
มุมมอง 1222 หลายเดือนก่อน
Leetcode 1905. Count Sub Islands | BFS | DFS | Potd Explained
1514. Path with Maximum Probability | BFS | DFS | Leetcode POTD Explained
มุมมอง 1732 หลายเดือนก่อน
1514. Path with Maximum Probability | BFS | DFS | Leetcode POTD Explained
590. N-ary Tree Postorder Traversal | Recursive + Iterative | Leetcode POTD Explained
มุมมอง 1372 หลายเดือนก่อน
590. N-ary Tree Postorder Traversal | Recursive Iterative | Leetcode POTD Explained
Today potd please
Actually I am outside.. so no potd till 29, Sorry
no problem bhaiya
Jeevesh bhai...aap writing interface kaunsa use karte ho??
Goodnotes 👌
Nice Explanation, method of prefix creation is awesome, I have done this using substr() function, but this one is vrery very much better
Thanks for sharing ✌️
very good explanation
nice one
Thanks ❤️❤️
how this red line is reflecting .. let me know if possible; like I was searching for a while for this query
I use Goodnotes, and it has these features
good explanation sir ji
Thank you ❤️❤️
bhai jara bolne ke speed ko kam kar or sath ke sath hopeless mat ho , kabhi kabhi kudh hi confuse lag rhe ho
Thank you so much for your feedback! ✌️
you have described well but don't be in hurry.Overall good explanation.
Thank you so much for your feedback! 😊 I’m glad you liked the explanation.
Awesome Approach, Bro! 💯👏
Thank you ❤️❤️
perfect bro
Thank you ❤️❤️
ye aap kon se board par padhate ho please can you share some details kyoki ye wala marker mere ko milta hi nahi maine bahut sare online board use kar liye please share some details related to software components nad hardware also. jisase padha sake online
App name - Goodnotes
acha explain kiya hai , bus ek bar dry run kar te toh aur acha
def lexicalOrder(self, n: int) -> List[int]: return list(map(int, sorted(list(map(str, range(1, n+1)))))) bro is this approach valid??
solve in O(n). sort use n log (n)
@@sumeetsamsam Absolutely buddy, I know that sort take n log n , but still this answer got accepted and beats 90%? I thought it would not be accepted! 😕
Constraints are small so it accepts it.
@@VaibhavNathe-k1w okk ! Thanks bro
Absolutely the Best Explanation, Bro! 🔥
I solved using brute force which is O( N)^2, it passed all the tests cases but Leetcode did not raise TLE, why?
Sometimes it was accepted in 10^8
no worries... we got your point... sometime it happens .... everything except the lps part was 100% correct .... shoutout to you for your consistency
Thank yo so much ❤️❤️
Sorry Everyone When s[i]!=s[j] then i need to fill longPal[j] = 0 but i fill longPal[j] = prev value Correct one is [0 1 0 0 0 1 2 2 0 1 2 2 3 4 5 6 7 0]
Your dry run was completely wrong! I checked it using testcase on leetcode.
Yaa bro sorry i has pin a comment for this..
@@codeby_naruto keep working bro 👍
Hey! you consistency is really amazing
Thank you ❤❤
Solution was easy to follow and articulated well! Thanks
❤️❤️
Amazing explanation !!
Thank you ❤️❤️
Very nice explanation
Thank you ❤️❤️
Thank you for the explanation
❤️❤️
nice explanation
❤️❤️
very nice solution brother ...i have subscribed your channel
❤️❤️
You can also upload gfg POTD
Ya sure i will do ❤️
Great today u provide source code in git hub ❤❤
bhaiya custom sort ka utna syntax dekar fill nhi aa rha ye to kuch true false karke work karta hai jaise hm ordering defined comparator in priority queue bhaiya ek video please banao comparator, string important function like istringstream and different function and custom sort aur acche se samjhane ke liye please
Okay bro i will do.. ✨✌️
Unable to build up the approach today approach aa gya tha user defined sorting ka syntaax nhi pta tha so here
Source code provide kro subscriber boom karenge ❤❤❤❤❤❤
On your tithun
Github
I will do from next video ❤️❤️
Make video of how to understand constraints ❤
Okay i will do ✌️✨
1 number
❤️
Code :- class Solution { public: vector<string> uncommonFromSentences(string A, string B) { unordered_map<string, int> count; istringstream iss(A + " " + B); while (iss >> A) count[A]++; vector<string> res; for (auto w : count) if (w.second == 1) res.push_back(w.first); return res; } };
very nice explanation
Thank you ❤️❤️
Code :- class Solution { public: int findMinDifference(vector<string>& T) { vector<int> ans; for (auto time : T) { string hour = time.substr(0, 2), minute = time.substr(3); int TotalMin = stoi(hour) * 60 + stoi(minute); ans.push_back(TotalMin); } sort(ans.begin(), ans.end()); // Adding the difference between the first and last times accounting for // wrap-around ans.push_back(ans[0] + 24 * 60); int minDiff = INT_MAX; for (int i = 1; i < ans.size(); ++i) { minDiff = min(minDiff, ans[i] - ans[i - 1]); } return minDiff; } };
Wow nice approach please explain intuition. After hearing you for 5 mins i was able to solve it. Thanks bhai!!!
Thank you ❤️❤️
Bhaiya please provide us solution of contest question solution please
Yaa sure ❤️
You explain nice from others make more video on other important question
Thank you ❤️❤️, I will do..
@codeby_naruto can you plz tell me what is wrong in my approach class Solution { public: int maxi=INT_MIN; void checkforeven(unordered_map<char,int>&mp,unordered_map<char,int>&mp1,int i){ int v=INT_MIN; for(auto it:mp){ if((it.second%2!=0)){ v=max(v,mp1[it.first]); } } if(v!=INT_MIN){ maxi=max(maxi,(i-v)); } else maxi=i+1; } int findTheLongestSubstring(string s) { unordered_map<char,int>mp,mp1; for(int i=s.size()-1;i>=0;i--){ if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'){ mp[s[i]]=i; } } for(int i=0;i<s.size();i++){ if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'){ mp1[s[i]]++; } checkforeven(mp1,mp,i); } return maxi; } };
very nice explanation
Thank you ❤️❤️
Code :- class Solution { public: int findTheLongestSubstring(string s) { unordered_map<char, int> hash = { {'a', 1}, {'e', 2}, {'i', 4}, {'o', 8}, {'u', 16}}; vector<int> bitset(32, -1); int mask = 0, maxLen = 0; for (int i = 0; i < s.size(); i++) { mask = mask ^ hash[s[i]]; if (mask != 0 && bitset[mask] == -1) bitset[mask] = i; maxLen = max(maxLen, i - bitset[mask]); } return maxLen; } };
very good
Thank you ❤️❤️
Code :- class Solution { public: int longestSubarray(vector<int>& nums) { int x = *max_element(nums.begin(), nums.end()); int ans = 0, len = 0; for (int num : nums) { if (num == x) ans = max(ans, ++len); else len = 0; } return ans; } };
good solution
Thank you ❤️❤️
Code :- class Solution { public: vector<int> xorQueries(vector<int>& A, vector<vector<int>>& queries) { vector<int> res; for (int i = 1; i < A.size(); ++i) A[i] ^= A[i - 1]; for (auto& q : queries) res.push_back(q[0] > 0 ? A[q[0] - 1] ^ A[q[1]] : A[q[1]]); return res; } };
very nice approach
Thank you ❤️❤️
Code :- class Solution { public: int countConsistentStrings(string allowed, vector<string>& words) { int res = words.size(); bool alpha[26] = {}; for (char c : allowed) alpha[c - 'a'] = true; for (string word : words) { for (char c : word) { if (!alpha[c - 'a']) { res--; break; } } } return res; } };
very good explanation
Thank you ❤️❤️
Thank you ❤️❤️
Code :- class Solution { public: int minBitFlips(int start, int goal) { int X = (start ^ goal); int count = 0; while (X) { if (X % 2) count++; X /= 2; } return count; } };