But, can you solve the question without converting to String?
@developer-docs17 сағат бұрын
Yes we can. I’ll try to make a video soon with this approach
@officialdreamplayz2 күн бұрын
wow its good ty
@developer-docsКүн бұрын
Thank you!
@lakshmi83479 күн бұрын
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-docs9 күн бұрын
Thank you ☺️
@mk686jjjj511 күн бұрын
You can just return --> s.toLowerCase();
@kavindarcreates12 күн бұрын
checking the array again with a new for loop is not optimal ig, try including that in the above loop itself!
@BabliKumari-u6v16 күн бұрын
how beautifully you explained it!!
@developer-docs16 күн бұрын
Thank you! 😊
@sonasrimu452017 күн бұрын
Thanks
@ritikranjan1224Ай бұрын
Wow!! What a code appreciable 🙏❤️
@mohammedhaneef3329Ай бұрын
Is there sny second chance of writting the exam if we fail to get in first attempt
@developer-docsАй бұрын
Each registration gives you a single attempt. So, I guess you need to register again to re-attempt
@craftedbyengineer5522Ай бұрын
Do we need to pay again for the second time?
@developer-docsАй бұрын
Yes
@ojasdhadgeАй бұрын
thankyou so much for these videos bro!
@developer-docsАй бұрын
Thank you 😊
@Bedivine777angelprayerАй бұрын
thanks
@developer-docsАй бұрын
You're welcome!
@DrownedinLiterartureАй бұрын
your count array should be of the size of maximum element+1
@TheBikerDude2024Ай бұрын
Greatly explained. Kudos, Bro.
@developer-docsАй бұрын
Thank you 😊
@gauravbhisikar6381Ай бұрын
why you did 2+2 when there was only single person on index 1
@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.
@saharshmaurya2 ай бұрын
which ide u r using? or which code editor?
@developer-docs2 ай бұрын
IntelliJ
@kuldeephajare85522 ай бұрын
Good one
@developer-docs2 ай бұрын
Thank you!
@shravyak85352 ай бұрын
clear and straightforward explaination
@developer-docs2 ай бұрын
Thank you ☺️
@Prashant_godbole2 ай бұрын
waste of time
@developer-docs2 ай бұрын
Sorry for wasting your time, hope you use your rest of the time efficiently
@hoddybhaba67042 ай бұрын
don't get how you are using masking...
@Jenasuraj2 ай бұрын
U have to solve it using b.s
@subee1282 ай бұрын
thanks
@developer-docs2 ай бұрын
You're welcome
@keerthi.m2 ай бұрын
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-docs2 ай бұрын
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.m2 ай бұрын
@@developer-docs ok, I understood. Thank you!
@aditikhedkar85142 ай бұрын
😊😊😊
@aditikhedkar85142 ай бұрын
Thankyou ❤
@developer-docs2 ай бұрын
You're welcome!
@keerthi.m2 ай бұрын
What is the name of this method of solving the problem?
@keerthi.m2 ай бұрын
Why do you initially keep P1 on the 3rd position of nums [1] ?
@developer-docs2 ай бұрын
p1 = m - 1 initially. So that we can compare that element with the element at p2.
@keerthi.m2 ай бұрын
@@developer-docs ok thanks for your explanation. Can you please tell us where are you currently working?
@SitaRam-js9fu2 ай бұрын
Great thanks for come back...u patiently and clearly explain...
@developer-docs2 ай бұрын
Thank you
@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-docs2 ай бұрын
Thank you. Keep going!
@shaifansari56662 ай бұрын
Thnaku so much for making these video please make it daily basic it give me a pattern how i solve these problem
@developer-docs2 ай бұрын
Thank you!
@MahiM-ze4hm3 ай бұрын
Can we use startsWith method bro
@developer-docs2 ай бұрын
Yeah, give it a try!
@MahiM-ze4hm3 ай бұрын
Solved
@MahiM-ze4hm3 ай бұрын
Solved No leading and trailing space So we can split using single spce
@MahiM-ze4hm3 ай бұрын
Solved
@MahiM-ze4hm3 ай бұрын
Solved
@chhatrikumar16773 ай бұрын
bhai pls i want solution of lc contest too
@MahiM-ze4hm3 ай бұрын
Why 2 more while loop bro?
@developer-docs3 ай бұрын
One to move start and one to move end
@SahityaA-m8m3 ай бұрын
Super clean explanation
@developer-docs3 ай бұрын
Thank you ☺️
@pranawkaushal29323 ай бұрын
//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;
@pranawkaushal29323 ай бұрын
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; } }
@pranawkaushal29323 ай бұрын
your solution is in O(n)2 complexity, please reduce TC for ur code.
@developer-docs3 ай бұрын
It's O(n) only. 32 is constant.
@BhojpuriAddas3 ай бұрын
please mntion topic name like linklist aray trees
@pranawkaushal29323 ай бұрын
//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
@pranawkaushal29323 ай бұрын
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)
@pranawkaushal29323 ай бұрын
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; }
@pranawkaushal29323 ай бұрын
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
@kushagragupta63543 ай бұрын
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
@legend020goat3 ай бұрын
Good ex[planatin
@developer-docs3 ай бұрын
Thank you ☺️
@pranawkaushal29323 ай бұрын
How do you pickup questions from leetcode? Can you guide me
@developer-docs3 ай бұрын
To practice you can follow the top interview 150 and solve problems per topic.