Rotate Array | Leetcode 189 | Top 150 interview question series

  Рет қаралды 31,638

Technosage

Technosage

Күн бұрын

Пікірлер: 59
@yashvardhansingh1903
@yashvardhansingh1903 Жыл бұрын
Hello mam, I don't know how to thank you because you are amazing, The way you teach , the way you solve the problems, applying the approach is much easier even for hard problems, Thank you so much mam for this amazing content........
@TechnosageLearning
@TechnosageLearning Жыл бұрын
Thanks for the feedback.. Stay tuned for more videos :)
@dibyendusaha1295
@dibyendusaha1295 3 ай бұрын
Time complexity: O(n) Space complexity: O(1) public class Solution { public void Rotate(int[] nums, int k) { int n=nums.Length; k=k%n; swap(nums,0,n-k-1); swap(nums,n-k,n-1); swap(nums,0,n-1); } private void swap(int[] nums, int left,int right) { while(left
@swastikkumar5773
@swastikkumar5773 10 ай бұрын
Mam please continue your leetcode problem series . it will helpful for us
@ssss22144
@ssss22144 28 күн бұрын
Please continue❤ "Don't stop coding goosebumps loading 🎉🎉🎉"
@sachinpatil1010
@sachinpatil1010 11 ай бұрын
Thank you for detailed information. It was really helpful !!!
@MohibulIslam-m7z
@MohibulIslam-m7z 10 ай бұрын
Ma'am, you are the best teacher in KZbin, please solve the top 150 DSA problem in Java ASAP , And it will help us to crack Interview. Thank you ma'am
@dp8jl
@dp8jl 9 күн бұрын
Great explanation, very intuitive!
@DesiInfo619
@DesiInfo619 10 ай бұрын
You teach so well!!
@Heavy-coder11
@Heavy-coder11 Ай бұрын
mene bhoot vedio dekh liye lekin nhi hua mujse i think i quit nd i got your vedio and now i easily solve thnxxx a lot mam ❤❤❤❤❤❤
@TechnosageLearning
@TechnosageLearning Ай бұрын
Thankyou for the kind words. Will work on more videos to help everyone better
@kaka_goat
@kaka_goat Ай бұрын
Really Really thank you so much mam , really appreciated your work
@adityarajsah414
@adityarajsah414 4 ай бұрын
Please do continue with the series, In entire you tube this is the only channel where I am able to understand the solution and co-relate with my approach. I understand because of medical condition you took a break, but please try uploading the videos as soon as possible please Amrita it's my humble request. And if you are not well, Get well soon and then upload the videos.
@TechnosageLearning
@TechnosageLearning 4 ай бұрын
Thank you for your message. We will be starting up with the videos soon.
@zenitsu5504
@zenitsu5504 2 ай бұрын
crystal clear explanation 🙇
@raneshmitra8156
@raneshmitra8156 3 ай бұрын
Please continue your Leet code problem series . it will helpful for us
@AnbuAnbu-xj8bx
@AnbuAnbu-xj8bx 3 ай бұрын
Excellent explanation mam, please post the problem solving videos mam ❤
@aasimahsan6167
@aasimahsan6167 9 ай бұрын
please continue the series of the this playlist it helps us alot
@TechnosageLearning
@TechnosageLearning 9 ай бұрын
Hi Due to some medical issues..I am on break..Will continue soon
@sanchay_khatwani
@sanchay_khatwani 3 ай бұрын
intresting explanation
@tricksforsolving2804
@tricksforsolving2804 6 ай бұрын
Clear explanation, helpful for me
@paniknoob6439
@paniknoob6439 6 ай бұрын
what does the k%nums.length; do?
@tricksforsolving2804
@tricksforsolving2804 6 ай бұрын
​​@@paniknoob6439it fix the issue of array index out of exception,if your K is more the array length,then we don't write the value of K directly, just divisible with array length & assign to K
@Lubi879
@Lubi879 2 ай бұрын
Good lecture
@lesa7p2lmansion
@lesa7p2lmansion 9 ай бұрын
why did you stop? can you put your linkedin
@PallabChatterjee18
@PallabChatterjee18 7 ай бұрын
Please continue the 150 questions series please maam
@LinhTran-om6qh
@LinhTran-om6qh 4 ай бұрын
idk but this is simpler: public static void rotate(int[] nums, int k) { int n = nums.length; k = k % n; int[] lastElements = Arrays.copyOfRange(nums, n - k, n); int[] firstElements = Arrays.copyOfRange(nums, 0, n - k); System.arraycopy(lastElements, 0, nums, 0, lastElements.length); System.arraycopy(firstElements, 0, nums, lastElements.length, firstElements.length); }
@malishagavali9225
@malishagavali9225 3 ай бұрын
the space complexity is linear not constant thats the drawback
@gaurshivam
@gaurshivam Жыл бұрын
Please continue this series
@TechnosageLearning
@TechnosageLearning Жыл бұрын
Will start uploading soon..
@sachintiwari4497
@sachintiwari4497 4 ай бұрын
thank you
@nirajvarma-z7d
@nirajvarma-z7d 2 ай бұрын
Can any one say what to change in the code if i want it rotate by left
@aniket5018
@aniket5018 Жыл бұрын
i know we are taking k=k%n for out of bound exceptions but why . i mean how k=k%n can help in this situation??
@piyumifernando2778
@piyumifernando2778 11 ай бұрын
Because if k = 100 (or evertime the value of k > n) after applying k = k % n the answer is k = 100 % 3 = 1. Every time it gets an answer for k which is less than n.
@piyumifernando2778
@piyumifernando2778 11 ай бұрын
So out of bound exceptions didn't appear when k > n.
@Mohd.FaisalKhan-oo9qj
@Mohd.FaisalKhan-oo9qj 6 ай бұрын
please continue your leetcode problems series
@TechnosageLearning
@TechnosageLearning 5 ай бұрын
We will be continuing the series soon. We are working on it
@AmitBiswas0142
@AmitBiswas0142 7 ай бұрын
Another 0 ms runtime solution great!!
@paniknoob6439
@paniknoob6439 6 ай бұрын
buddy , what does the k%nums.length; do?
@webtestingui7187
@webtestingui7187 Жыл бұрын
Hello,could you please post those questions only
@TechnosageLearning
@TechnosageLearning Жыл бұрын
Hi...Yes,I will continue this series...stay tuned
@shahbazalam162
@shahbazalam162 9 ай бұрын
ma'am please continue the interview series
@jbr.1
@jbr.1 9 ай бұрын
Please come back
@TechnosageLearning
@TechnosageLearning 9 ай бұрын
Very soon
@CodingJoySoul
@CodingJoySoul Жыл бұрын
Why have you guys stopped posting solutions?
@TechnosageLearning
@TechnosageLearning Жыл бұрын
Hi.. Due to some medical issues, We couldn't post solutions for a while..Will continue posting solutions very soon..
@DSASolutions
@DSASolutions 2 ай бұрын
good
@brp3522
@brp3522 6 ай бұрын
What happened to you amrita didi we really miss your concepts
@B_Patidar88
@B_Patidar88 2 ай бұрын
This code not accepted by leetcode 😢
@muhammadsijal815
@muhammadsijal815 3 ай бұрын
you'll be back soon right ?
@TechnosageLearning
@TechnosageLearning 3 ай бұрын
Yes will be back soon, the break was due to medical emergency, now will start soon.
@muhammadsijal815
@muhammadsijal815 2 ай бұрын
@@TechnosageLearning when can we expect you to upload ?
@musamehdiyevv
@musamehdiyevv 6 ай бұрын
public void rotate(int[] nums, int k) { int temp = 0; while (k > 0) { temp = nums[nums.length - 1]; for (int i = nums.length - 1; i > 0; i--) { nums[i] = nums[i-1]; } nums[0] = temp; k--; } }
@Vanshkumar-co5pm
@Vanshkumar-co5pm 29 күн бұрын
thanks for the easier solution!!
@anuragpanwar912
@anuragpanwar912 Жыл бұрын
This my updated code hopw uoy like class Solution { public void rotate(int[] arr, int k) { if(arr.length 0) { int last = arr[arr.length - 1]; for (int i = arr.length - 1; i > 0; i--) { arr[i] = arr[i - 1]; } arr[0] = last; k--; } } static void reverseArray(int arr[], int start, int end) { while (start < end) { int temp = arr[start]; arr[start] = arr[end]; arr[end] = temp; start++; end--; } } }
@SandraSaade
@SandraSaade 10 ай бұрын
import java.util.Scanner; public class Main { public static void shiftArray(int[] a, int k) { for(int j=1;j
@nizamuddinkhan7408
@nizamuddinkhan7408 6 ай бұрын
time complexity is o(n2) which is incorrect as per leetcode
@paniknoob6439
@paniknoob6439 6 ай бұрын
what does the k%nums.length; do?
@DavisTibbz
@DavisTibbz 2 ай бұрын
Prevent overflow, just in case k is very large. This will return a value less than nums.length
Merge strings alternately | Leetcode 1768
9:09
Technosage
Рет қаралды 828
Lecture21: Solving LeetCode/CodeStudio Questions [Arrays]
33:32
CodeHelp - by Babbar
Рет қаралды 469 М.
Thank you Santa
00:13
Nadir Show
Рет қаралды 52 МЛН
Deadpool family by Tsuriki Show
00:12
Tsuriki Show
Рет қаралды 5 МЛН
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Codebagel
Рет қаралды 308 М.
I Solved 100 LeetCode Problems
13:11
Green Code
Рет қаралды 261 М.
How to Rotate Array ( Leetcode : 189 ) | Java | Tamil
9:58
CSE MAANAVAN
Рет қаралды 822
Rotate Array - Leetcode 189 - Python
8:59
NeetCode
Рет қаралды 161 М.
LeetCode Rotate Array Solution Explained - Java
6:50
Nick White
Рет қаралды 88 М.
The unfair way I got good at Leetcode
6:47
Dave Burji
Рет қаралды 498 М.
I solved 541 Leetcode problems. But you need only 150.
7:42
Sahil & Sarra
Рет қаралды 2,4 МЛН
Thank you Santa
00:13
Nadir Show
Рет қаралды 52 МЛН