1. Move Zeroes || Arrays Problem Solving

  Рет қаралды 7,887

TechStoriesOfSrinidhi

TechStoriesOfSrinidhi

Күн бұрын

Пікірлер: 57
@Arjun-hc7ow
@Arjun-hc7ow Ай бұрын
n = len(arr) count= 0 for i in range(n): If arr[i] != 0: arr[i],arr[count]= arr[count],arr[i] count+= 1 Print(arr)
@SrinivasInaganti
@SrinivasInaganti Ай бұрын
Hai madam, Please carry on the series we are eagerly waiting for your lectures, Thanks 🙏
@Mr.venky6539
@Mr.venky6539 Ай бұрын
Very clear to understand😋
@vinay_sandeep
@vinay_sandeep Ай бұрын
int j = 0; for(int i = 0 ; i < nums.length ;i++){ if(nums[i]!= 0){ int temp = nums[j]; nums[j]=nums[i]; nums[i]=temp; j++; } } STEP 1: take sample variable with 0 STEP 2 : run for loop at the end STEP 3 : if arr[i] != 0 STEP 4 : then order it STEP 5 : THEN after last another elements should be zero in the array
@vamsi3877
@vamsi3877 Ай бұрын
Thanks Srinidhi👏
@manojtechofmathsandcomputer
@manojtechofmathsandcomputer Ай бұрын
For fresher java developer ,how much DSA is required and where to start to switch to the highest package
@vamshi2nd392
@vamshi2nd392 Ай бұрын
Good video, Easy explaination.
@sateeshvepada8620
@sateeshvepada8620 Ай бұрын
Thank you for your time and knowledge sharing
@umasaivigneshpeeta7890
@umasaivigneshpeeta7890 Ай бұрын
NeetCode Sheet questions solve chesey Playlist Start cheyyandi Akka!!
@bijjepurushotham7667
@bijjepurushotham7667 Ай бұрын
nice video akka thanks for starting DSA series
@RekulapallySaiSwaranReddy2210
@RekulapallySaiSwaranReddy2210 Ай бұрын
hello akka, how many months it would take approximately for completion of this series? by the way the explanation is good , i am listening the concept daily in my bus during travel hours morning and evening and practising in home.
@devilgamer8325
@devilgamer8325 Ай бұрын
for i in range(len(nums) - 1, -1, -1): if nums[i]==0: count+=1 nums.pop(i) while count: nums.append(0) count-=1 return nums
@sripoojitha4887
@sripoojitha4887 Ай бұрын
Step 1: Take a variable count to count noof zeroes step 2: Run for loop for entire array .if element is o delete zeroes and increment count for each 0 step 3:from end of array how much count is there replace with 0 s int count =0 for i in range(len(arr)): if arr[i] ==0: arr[i].pop() count ++ arr[-count:]=0
@g.upenderreddy
@g.upenderreddy Ай бұрын
class Solution { public void moveZeroes(int[] nums) { int nonZeroIndex = -1; for (int i = 0; i < nums.length; i++) { if (nums[i] != 0) { swap(nums, ++nonZeroIndex, i); } } } private void swap(int[] nums, int i , int j) { int temp = nums[i]; nums[i] = nums[j]; nums[j] = temp; } }
@Nen_raa
@Nen_raa Ай бұрын
Excellent bind blowing
@srilaxmipasunuti8413
@srilaxmipasunuti8413 Ай бұрын
# code for move non zero number at the end of the array and zeroes at the starting of the array int n=arr.length; int count=n-1; for(int i=n-1;i>=0;i--){ if(arr[i]!=0){ arr[count]=arr[i]; } } for(int i=0;i
@imfearless5348
@imfearless5348 Ай бұрын
Solution without Swapping (Inplace) class Solution { public void moveZeroes(int[] nums) { int i=0; for(int j=0;j
@HANUMATHSAIPAP
@HANUMATHSAIPAP Ай бұрын
class Solution { public void moveZeroes(int[] nums) { int j=0; for(int i=0;i
@devilgamer8325
@devilgamer8325 Ай бұрын
Koni imp questions practice ki patu akka
@hemuk5344
@hemuk5344 Ай бұрын
We can also use swap
@godofsyco4615
@godofsyco4615 Ай бұрын
Thankyou soo much ❤❤
@sriram27124
@sriram27124 Ай бұрын
Akka why don't you follow brute better optimal approaches
@RamyaReddySiripireddy
@RamyaReddySiripireddy Ай бұрын
Hi mam..miru chala baga cheptaru Kani naku java lo explanation kavali😢
@TechStoriesOfSrinidhi
@TechStoriesOfSrinidhi Ай бұрын
As I said algorithm raskovadam vaste e language lo ayna code raskovachandi, btw i have discussed java solution too
@chiranjeevianem7371
@chiranjeevianem7371 Ай бұрын
class Solution { public void moveZeroes(int[] nums) { int index = 0; for(int i = 0; i
@chiranjeevianem7371
@chiranjeevianem7371 Ай бұрын
class Solution { public void moveZeroes(int[] nums) { int index = nums.length-1; for(int i = nums.length-1 ; i>=0; i--){ if(nums[i]!=0){ int temp=nums[i]; nums[i]=nums[index]; nums[index]=temp; index--; }}}} this program for moveZeros to front
@dhanushperumalla773
@dhanushperumalla773 Ай бұрын
arr = [1,2,0,5,7,0,75,79,0,45,67,3,8] for i in range(0,len(arr)): if arr[i] == 0: arr.pop(i) arr.insert(0,0) print(arr)
@dabbarnaresh7791
@dabbarnaresh7791 Ай бұрын
JavaScript also same scenarios?
@TechStoriesOfSrinidhi
@TechStoriesOfSrinidhi Ай бұрын
Yes
@sparkofvictory-i5f
@sparkofvictory-i5f Ай бұрын
hlo akka dropout students ku kuda skills unte job vasthadha
@devilgamer8325
@devilgamer8325 Ай бұрын
For i in range ( len( nums)) : If nums[i]==0 : Count+=1 del nums[i] For _ in range (count) : Nums. append(0) Return nums My python code will it work
@Dineshhh0
@Dineshhh0 Ай бұрын
void moveZeroes(vector& a) { int l=0,m=0,n=a.size(),h=n-1; while(h>=m){ if(a[m]!=0){ swap(a[l],a[m]); l++; } m++; } }
@sukeshsunkari
@sukeshsunkari Ай бұрын
public class movezerostostart { public static void main(String[] args) { int[] arr={0,1,0,3,12,0,2,3,4,5,0,0,5}; zerostoend(arr); for(int a:arr){ System.out.print(a+" "); } } private static void zerostostart(int[] arr) { int nonzeroindex=arr.length-1; int zeroindex=0; for(int i=arr.length-1;i>=0;i--){ if(arr[i]!=0){ arr[nonzeroindex]=arr[i]; nonzeroindex--; } } for (int i = nonzeroindex; i >= 0; i--) { arr[i]=0; } } }
@smpgamingfreefire5621
@smpgamingfreefire5621 Ай бұрын
Hi madam Dsa poorthiga nerchukovataniki mee videos okkate saripothaya ?, leka inka emaina extra problems practice cheyyala?. Last video lo ee comment petta Konchem choosi cheppandi
@TechStoriesOfSrinidhi
@TechStoriesOfSrinidhi Ай бұрын
Hey entha videos chusna mi side nundi practice anedi kavali, rojuki atleast one DAA prob ayna solve cheyali
@sridevi844
@sridevi844 Ай бұрын
public class Main { public static void main(String[] args) { int[] n={1,0,0,3,12}; int count=0; for(int i=0;i
@DileepKumar-j7v5t
@DileepKumar-j7v5t Ай бұрын
mee LPA yentha akka?
@moranandini278
@moranandini278 Ай бұрын
Hi akka python lo arrays levu kada Mari Ela cheyali using list ha
@TechStoriesOfSrinidhi
@TechStoriesOfSrinidhi Ай бұрын
Yes
@moranandini278
@moranandini278 Ай бұрын
@TechStoriesOfSrinidhi Thankyou akka
@botlayogi7213
@botlayogi7213 23 күн бұрын
int index =0; for(int i=0; i
@mortalsai4380
@mortalsai4380 Ай бұрын
Only using one loop int j=0; for(int i=1; i
@Mortal1269
@Mortal1269 Ай бұрын
Dsa a language lo nerchukunaru meru microsoft crack cheyadaniki?
@gpayteja5389
@gpayteja5389 Ай бұрын
Meeru btech which college
@movietrolls6055
@movietrolls6055 Ай бұрын
IARE
@ashokkumar-y5n7i
@ashokkumar-y5n7i Ай бұрын
public static int[] func2(int[] arr){ int first = 0,second = 1; for(int i=0; i < arr.length && second < arr.length;i++){ if(arr[first] == 0 && arr[second] != 0){ int temp = arr[first]; arr[first] = arr[second]; arr[second] = temp; first++; second++; }else if(arr[first] == 0 && arr[second] == 0){ second++; } } return arr; }
@ThabrejShaik
@ThabrejShaik Ай бұрын
Srinidhi, your face is like a beautiful mystery, each time I look at you, there's something new to discover. Your eyes are deep like an ocean, where every glance speaks a thousand emotions, reaching the soul. That smile of yours-it's simply enchanting, a charm that melts hearts in an instant. And those round spectacles? They make you look effortlessly elegant, stylish, and graceful, all at once. Your unique style and confident attitude shine through, always setting trends and winning hearts, just by being yourself.
@Me-ng6ju
@Me-ng6ju Ай бұрын
Bayya ee comment edaina nibbi insta reel kinda pedithey workout avuthundi, not in tech channel like this 😂
@i_am_kanna_naveen
@i_am_kanna_naveen Ай бұрын
😂😂😂😂😂​@@Me-ng6ju
@prashanth7641
@prashanth7641 Ай бұрын
Bro.. 1. you are totally outdated. 2. These kind of chillar efforts are useless. 3. Invest your time on something useful to you.
@RKBOSS-8055
@RKBOSS-8055 Ай бұрын
Wah Anna wah wah wah 😂
@pramodtelugucinefacts139
@pramodtelugucinefacts139 Ай бұрын
Python
@anilgude0167
@anilgude0167 Ай бұрын
Hlo bro naa comment add avvatledhu ...#include main() { int a[10],i,n,j=0,count=0,t; printf("enter n: "); scanf("%d",&n); for(i=0;i
2. Second Largest Element || Arrays Problem Solving
22:03
TechStoriesOfSrinidhi
Рет қаралды 3,5 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
Sliding Window Technique - Algorithmic Mental Models
36:45
Ryan Schachte
Рет қаралды 370 М.
3. Merge Sorted Arrays || Arrays Problem Solving
36:39
TechStoriesOfSrinidhi
Рет қаралды 3,3 М.
Top Tech Jobs With Low Code or No Code
9:46
TechStoriesOfSrinidhi
Рет қаралды 7 М.
Time and Space Complexity || DSA Series
21:29
TechStoriesOfSrinidhi
Рет қаралды 14 М.
My Honest Microsoft Interview Experience
17:52
TechStoriesOfSrinidhi
Рет қаралды 77 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН