Пікірлер
@vikasswaroopsen8865
@vikasswaroopsen8865 6 сағат бұрын
best video h aapka pure yt me..
@developer-docs
@developer-docs 4 сағат бұрын
Thank you!
@ashimroy3891
@ashimroy3891 18 сағат бұрын
But, can you solve the question without converting to String?
@developer-docs
@developer-docs 17 сағат бұрын
Yes we can. I’ll try to make a video soon with this approach
@officialdreamplayz
@officialdreamplayz 2 күн бұрын
wow its good ty
@developer-docs
@developer-docs Күн бұрын
Thank you!
@lakshmi8347
@lakshmi8347 9 күн бұрын
Great video, simpler explanation!! I am struggling to understand this approach, Right after watching 4mins of your video, I totally understood this concept , Thanks a lot!
@developer-docs
@developer-docs 9 күн бұрын
Thank you ☺️
@mk686jjjj5
@mk686jjjj5 11 күн бұрын
You can just return --> s.toLowerCase();
@kavindarcreates
@kavindarcreates 12 күн бұрын
checking the array again with a new for loop is not optimal ig, try including that in the above loop itself!
@BabliKumari-u6v
@BabliKumari-u6v 16 күн бұрын
how beautifully you explained it!!
@developer-docs
@developer-docs 16 күн бұрын
Thank you! 😊
@sonasrimu4520
@sonasrimu4520 17 күн бұрын
Thanks
@ritikranjan1224
@ritikranjan1224 Ай бұрын
Wow!! What a code appreciable 🙏❤️
@mohammedhaneef3329
@mohammedhaneef3329 Ай бұрын
Is there sny second chance of writting the exam if we fail to get in first attempt
@developer-docs
@developer-docs Ай бұрын
Each registration gives you a single attempt. So, I guess you need to register again to re-attempt
@craftedbyengineer5522
@craftedbyengineer5522 Ай бұрын
Do we need to pay again for the second time?
@developer-docs
@developer-docs Ай бұрын
Yes
@ojasdhadge
@ojasdhadge Ай бұрын
thankyou so much for these videos bro!
@developer-docs
@developer-docs Ай бұрын
Thank you 😊
@Bedivine777angelprayer
@Bedivine777angelprayer Ай бұрын
thanks
@developer-docs
@developer-docs Ай бұрын
You're welcome!
@DrownedinLiterarture
@DrownedinLiterarture Ай бұрын
your count array should be of the size of maximum element+1
@TheBikerDude2024
@TheBikerDude2024 Ай бұрын
Greatly explained. Kudos, Bro.
@developer-docs
@developer-docs Ай бұрын
Thank you 😊
@gauravbhisikar6381
@gauravbhisikar6381 Ай бұрын
why you did 2+2 when there was only single person on index 1
@developer-docs
@developer-docs Ай бұрын
Left and right are pointing to index1, so the logic will add both the values in those indices and compare with limit. So in this case too if left + right > limit, then send right and right--. Else if left + right <= limit, then send both and left++, right--. And that will be the last iteration always and no need to check further - as they crossed each other.
@saharshmaurya
@saharshmaurya 2 ай бұрын
which ide u r using? or which code editor?
@developer-docs
@developer-docs 2 ай бұрын
IntelliJ
@kuldeephajare8552
@kuldeephajare8552 2 ай бұрын
Good one
@developer-docs
@developer-docs 2 ай бұрын
Thank you!
@shravyak8535
@shravyak8535 2 ай бұрын
clear and straightforward explaination
@developer-docs
@developer-docs 2 ай бұрын
Thank you ☺️
@Prashant_godbole
@Prashant_godbole 2 ай бұрын
waste of time
@developer-docs
@developer-docs 2 ай бұрын
Sorry for wasting your time, hope you use your rest of the time efficiently
@hoddybhaba6704
@hoddybhaba6704 2 ай бұрын
don't get how you are using masking...
@Jenasuraj
@Jenasuraj 2 ай бұрын
U have to solve it using b.s
@subee128
@subee128 2 ай бұрын
thanks
@developer-docs
@developer-docs 2 ай бұрын
You're welcome
@keerthi.m
@keerthi.m 2 ай бұрын
why merge function is given in void return type? As the output of the program should return an array, right? It means the return type should be int[], right? Please clarify!
@developer-docs
@developer-docs 2 ай бұрын
merge() function has void return type. It means we're modifying the input array nums1[] itself. No need to return it as it's already present as input parameter.
@keerthi.m
@keerthi.m 2 ай бұрын
@@developer-docs ok, I understood. Thank you!
@aditikhedkar8514
@aditikhedkar8514 2 ай бұрын
😊😊😊
@aditikhedkar8514
@aditikhedkar8514 2 ай бұрын
Thankyou ❤
@developer-docs
@developer-docs 2 ай бұрын
You're welcome!
@keerthi.m
@keerthi.m 2 ай бұрын
What is the name of this method of solving the problem?
@keerthi.m
@keerthi.m 2 ай бұрын
Why do you initially keep P1 on the 3rd position of nums [1] ?
@developer-docs
@developer-docs 2 ай бұрын
p1 = m - 1 initially. So that we can compare that element with the element at p2.
@keerthi.m
@keerthi.m 2 ай бұрын
@@developer-docs ok thanks for your explanation. Can you please tell us where are you currently working?
@SitaRam-js9fu
@SitaRam-js9fu 2 ай бұрын
Great thanks for come back...u patiently and clearly explain...
@developer-docs
@developer-docs 2 ай бұрын
Thank you
@divanshugarg_
@divanshugarg_ 2 ай бұрын
sir literally past week with help of your solutions and explanations I have done 14-15 ques of DSA your way of teaching is soo good ❤🙌
@developer-docs
@developer-docs 2 ай бұрын
Thank you. Keep going!
@shaifansari5666
@shaifansari5666 2 ай бұрын
Thnaku so much for making these video please make it daily basic it give me a pattern how i solve these problem
@developer-docs
@developer-docs 2 ай бұрын
Thank you!
@MahiM-ze4hm
@MahiM-ze4hm 3 ай бұрын
Can we use startsWith method bro
@developer-docs
@developer-docs 2 ай бұрын
Yeah, give it a try!
@MahiM-ze4hm
@MahiM-ze4hm 3 ай бұрын
Solved
@MahiM-ze4hm
@MahiM-ze4hm 3 ай бұрын
Solved No leading and trailing space So we can split using single spce
@MahiM-ze4hm
@MahiM-ze4hm 3 ай бұрын
Solved
@MahiM-ze4hm
@MahiM-ze4hm 3 ай бұрын
Solved
@chhatrikumar1677
@chhatrikumar1677 3 ай бұрын
bhai pls i want solution of lc contest too
@MahiM-ze4hm
@MahiM-ze4hm 3 ай бұрын
Why 2 more while loop bro?
@developer-docs
@developer-docs 3 ай бұрын
One to move start and one to move end
@SahityaA-m8m
@SahityaA-m8m 3 ай бұрын
Super clean explanation
@developer-docs
@developer-docs 3 ай бұрын
Thank you ☺️
@pranawkaushal2932
@pranawkaushal2932 3 ай бұрын
//The trick here is that : //Bitwise-AND of any two numbers will always produce a number less than or equal to the smaller number. /** 12 ---- 1100 11 ---- 1011 10 ---- 1010 9 ---- 1001 8 ---- 1000 7 ---- 0111 6 ---- 0110 5 ---- 0101 Desired Range: [5,12] Starting from 12, the loop will first do 12 & 11 = 8 Next iteration, the loop will do 8 & 7 = 0 why did we skip anding of 10,9? Because even if we did so, the result would eventually be anded with 8 whose value would be lesser than equal to 8. */ while(right>left){ right=right & right - 1; } return left & right;
@pranawkaushal2932
@pranawkaushal2932 3 ай бұрын
class Solution { public int singleNumber(int[] nums) { int ones = 0, twos = 0; for (int num : nums) { // 'ones' keeps track of bits that have appeared 1 time (modulo 3) ones = (ones ^ num) & ~twos; // 'twos' keeps track of bits that have appeared 2 times (modulo 3) twos = (twos ^ num) & ~ones; } // The answer is in 'ones', since it represents the bits that appeared exactly once. return ones; } }
@pranawkaushal2932
@pranawkaushal2932 3 ай бұрын
your solution is in O(n)2 complexity, please reduce TC for ur code.
@developer-docs
@developer-docs 3 ай бұрын
It's O(n) only. 32 is constant.
@BhojpuriAddas
@BhojpuriAddas 3 ай бұрын
please mntion topic name like linklist aray trees
@pranawkaushal2932
@pranawkaushal2932 3 ай бұрын
//constant space public int rob(int[] nums) { int prevOfPrev = 0; int prev = nums[0];//phla ghar int cur = 0; for (int i = 2; i <= nums.length; i++) { int skipped = prev; int robbed = nums[i - 1] + prevOfPrev; cur = Math.max(robbed, skipped); prevOfPrev = prev; prev = cur; } return cur; } Here is the best solution
@pranawkaushal2932
@pranawkaushal2932 3 ай бұрын
public int findPeakElement(int[] nums) { int left=0; int right=nums.length-1; while(left<right){ int mid=left+(right-left)/2; if(nums[mid]<nums[mid+1]){ left=mid+1; }else{ right=mid; } } return left; } why not using below code, explain while(left<=right)
@pranawkaushal2932
@pranawkaushal2932 3 ай бұрын
Not a good solution Suppose we have a linked list 1 -> 2 -> 3 -> 4 -> 5 and n = 2. The goal is to remove the 2nd node from the end, which is 4. After removal, the modified list will be 1 -> 2 -> 3 -> 5. Diagram: Let's visually represent the process with a diagram: Initial Linked List: 1 -> 2 -> 3 -> 4 -> 5 We want to remove the 2nd node from the end, which means we need to find the node n positions from the end. In this case, n = 2. Using the two-pointer approach, we initialize two pointers, fast and slow, both pointing to the head of the linked list. We also create a dummy node (dummy) and set its next pointer to the head. dummy -> 1 -> 2 -> 3 -> 4 -> 5 fast slow Move fast n+1 steps ahead. In this case, move it 3 steps ahead (n + 1 = 3). dummy -> 1 -> 2 -> 3 -> 4 -> 5 fast slow Move both fast and slow pointers one step at a time until fast reaches the end. dummy -> 1 -> 2 -> 3 -> 4 -> 5 fast slow The n-th node from the end (in this case, 4) has been successfully removed. Finally, we return dummy.next as the new head of the modified linked list, which is 1 -> 2 -> 3 -> 5. below is the solution public ListNode removeNthFromEnd(ListNode head, int n) { ListNode dummy = new ListNode(0); dummy.next = head; ListNode fast = dummy; ListNode slow = dummy; // Move the fast pointer n+1 steps ahead for (int i = 0; i <= n; i++) { fast = fast.next; } // Move both pointers until the fast pointer reaches the end while (fast != null) { fast = fast.next; slow = slow.next; } //now slow is just before the element to be removed //so remove slow's next pointer and return head // Remove the nth node from the end slow.next = slow.next.next; return dummy.next; }
@pranawkaushal2932
@pranawkaushal2932 3 ай бұрын
int colFlips = 0; for (int i = 0; i < cols; i++) { int[] column = new int[rows]; for (int j = 0; j < rows; j++) { column[j] = grid[j][i]; } colFlips += findMinFlips(column); } This part is confusing me
@kushagragupta6354
@kushagragupta6354 3 ай бұрын
thank you shared the most understandable solution for this very tough question, if only you could explain a little bit more abt lambda epression used here would be great
@legend020goat
@legend020goat 3 ай бұрын
Good ex[planatin
@developer-docs
@developer-docs 3 ай бұрын
Thank you ☺️
@pranawkaushal2932
@pranawkaushal2932 3 ай бұрын
How do you pickup questions from leetcode? Can you guide me
@developer-docs
@developer-docs 3 ай бұрын
To practice you can follow the top interview 150 and solve problems per topic.
@pranawkaushal2932
@pranawkaushal2932 3 ай бұрын
bhai apna linkedIn account dena