1920. Build Array from Permutation | Zero to FAANG Kunal | Assignment Solution | Leetcode | Shapnesh

  Рет қаралды 18,952

Programmers Zone

Programmers Zone

Күн бұрын

Пікірлер: 64
@karunyadav6345
@karunyadav6345 3 жыл бұрын
Amazing solution bro.🔥.. Kindly please solve my one doubt.. why can't we use single for loop and write both the conditions in that for loop only ..l have dry runned the code but l'm not able to understand why the answer is coming different when l am using both the conditions in one for loop only ....please please help me 🙏
@karunyadav6345
@karunyadav6345 3 жыл бұрын
Kindly please reply brother Apka hi Sahara h ab🙏 ap ignore mat karna plz
@ProgrammersZone
@ProgrammersZone 3 жыл бұрын
@@karunyadav6345 Yepp It will not give the same result if we run both the conditions in one loop as the value of each index changes in each iteration for example if our original array is [1, 2, 3, 0] and then after first iteration it becomes [2, 2, 3, 0] now after second iteration it becomes [2, 3, 3 0] after third iteration it becomes [2,3, 0, 0] and the answer till here is correct but once you do it for last iteration you'll get nums[nums[3]] as 2 which you should have got as 1 if you had gone in the videos approch so as long as the numbers are in increasing order it is fine but the testcases fail when numbers are in non increasing order so you must write both of them differently I hope this helps :)
@memories8037
@memories8037 Жыл бұрын
tum bahut sahi kam kar rahe ho mansukh bhai
@kallabhargavi-d7j
@kallabhargavi-d7j 8 ай бұрын
nums=[0,2,1,5,3,4] result1=[] for i in range(len(nums)): result=nums[nums[i]] result1.append(result) print(result1)
@Kumkum-n9v
@Kumkum-n9v 10 ай бұрын
how did you come up with this approach? I mean the thought process
@prekshathakkar5846
@prekshathakkar5846 Жыл бұрын
Very good explanation. But I have one doubt while doing the second method, how can we derive the equation: nums[i] = nums[i] + n*(nums[nums[i]] % n) I mean how do we come to know that we need to use this equation?
@amitprajapati3630
@amitprajapati3630 Жыл бұрын
Nice solution brother
@SHUBHAMSINGH-f2g
@SHUBHAMSINGH-f2g Жыл бұрын
nice explain sir😊
@deepakchaudhary01
@deepakchaudhary01 Жыл бұрын
I really loved the way you explained, much appreciated !!
@jamtaranumber2841
@jamtaranumber2841 3 жыл бұрын
thanks bruhh keep it up tumhe maang hi milega aise meri manokhmna
@ProgrammersZone
@ProgrammersZone 2 жыл бұрын
Meri bhi aapke liye _/\_ Keep going :)
@shubhammaske3504
@shubhammaske3504 Жыл бұрын
Nice ... But how to find such type of logic or formula during attending question. could you please explain
@ProgrammersZone
@ProgrammersZone Жыл бұрын
Just write 4-5 examples and you'll observe the pattern even if you aren't able to its fine eventually with time it will happen but make sure ki har questions ko solve karne ke baad solution section me naye naye ways dekho with time tumhare mann me bhi click hone lagenge ye ideas
@neharathour6115
@neharathour6115 2 жыл бұрын
Bhai maja aa gya solution ma
@ronitbanerjee2678
@ronitbanerjee2678 2 жыл бұрын
Great explanation... thanks alot
@ProgrammersZone
@ProgrammersZone 2 жыл бұрын
Glad it was helpful!
@abhishekkr8077
@abhishekkr8077 Жыл бұрын
Dhanyawad bhai..hmse 1 Q v nhi bnta hai aap kaisa soch lete ho..? kunal bhaiya ka videos dekhna suru kiye the phle Q me hi fass gye 😑
@ProgrammersZone
@ProgrammersZone Жыл бұрын
Bhai kunal ke videos to theek hai but follow Take U Forward and their videos for DSA. Follow A2Z DSA sheet and try the questions by yourself and look leetcode discuss section
@gauravmishra7158
@gauravmishra7158 2 жыл бұрын
so this means aise questions jisne lgae ho whi kr skta hai qki ye formula pta hona chahie already right?
@veersharma7867
@veersharma7867 10 ай бұрын
de we??
@archana09424
@archana09424 2 жыл бұрын
Thank you so much for such a good explanation.you are doing a great job.
@ProgrammersZone
@ProgrammersZone 2 жыл бұрын
Happy to help :)
@neharathour6115
@neharathour6115 2 жыл бұрын
Bro make more and more vedio like this please
@kumkumrathour5015
@kumkumrathour5015 2 жыл бұрын
Mast explation sir
@ProgrammersZone
@ProgrammersZone 2 жыл бұрын
Thanks a lot :)
@sakethsaketh750
@sakethsaketh750 2 жыл бұрын
thanks for the solution and you are very good at the explanation /// thank you so much
@ProgrammersZone
@ProgrammersZone 2 жыл бұрын
You're Welcome
@junaidkhalidi7099
@junaidkhalidi7099 2 жыл бұрын
@@ProgrammersZone space comp. is O(1)
@surajmaity6194
@surajmaity6194 2 жыл бұрын
Thank you
@ProgrammersZone
@ProgrammersZone 2 жыл бұрын
You're welcome
@sufiyanjamadar7800
@sufiyanjamadar7800 2 жыл бұрын
Bro plzz continue this series☺️
@ProgrammersZone
@ProgrammersZone 2 жыл бұрын
Started Bro :) kzbin.info/www/bejne/fX27mJiuaMyUrsU
@vaishnavia.n.312
@vaishnavia.n.312 3 жыл бұрын
Thank you very much, Great explanation, keep it up.
@ProgrammersZone
@ProgrammersZone 3 жыл бұрын
Thanks a lot :)
@sourin.majumdar
@sourin.majumdar 2 жыл бұрын
Bro aise formula dimaag mei aayegi kaise? memory optimised mei jo use ki hai
@ProgrammersZone
@ProgrammersZone 2 жыл бұрын
Will make updated video with intution soon, at that time I was completely beginner so didn't have any idea of how to create videos :)
@rutikabhanuse7354
@rutikabhanuse7354 4 ай бұрын
​@@ProgrammersZone par apne ab tak bataya nahi😢
@gauravchoubey5525
@gauravchoubey5525 3 жыл бұрын
Nice explanation bro..bas woh red ki jagah white marker rakho plss dikh nhi rha tha ache ..
@ProgrammersZone
@ProgrammersZone 3 жыл бұрын
Sure bro, I'll take care of that from next time. Do share with your friends :)
@brp3522
@brp3522 Жыл бұрын
Aur ye question easy marked hai aur sabse jyada acceptance ke saath🙂☕
@memogamer285
@memogamer285 2 жыл бұрын
bro logic kaise build kre apki tara?
@ProgrammersZone
@ProgrammersZone 2 жыл бұрын
Just solve more and more examples you'll notice the pattern, also try to learn different approaches for one question.
@mukulsehgal2190
@mukulsehgal2190 2 жыл бұрын
great
@ProgrammersZone
@ProgrammersZone 2 жыл бұрын
Thank you
@kumkumrathour5015
@kumkumrathour5015 2 жыл бұрын
Continue
@neharathour6115
@neharathour6115 2 жыл бұрын
I like share and subscribe you please make these types of vedio more and more
@abhinavkumar5000
@abhinavkumar5000 3 жыл бұрын
Thanks a lot :)
@ProgrammersZone
@ProgrammersZone 3 жыл бұрын
You're welcome! :)
@shivamdalania
@shivamdalania 2 жыл бұрын
Bro how to find this equation?
@ProgrammersZone
@ProgrammersZone 2 жыл бұрын
Bro just try out some examples and soon you'll start getting all this stuff :)
@Dekh_rha_hai_vinod.
@Dekh_rha_hai_vinod. 10 ай бұрын
Bro 1920 ???
@animeshpandey4138
@animeshpandey4138 2 жыл бұрын
bhai kunal bhai ke hi assignments bahut hai ya phir aur bhi karne chahiye khudh se agar khudh se karne hai to bata do kaha se karu please bhaiya
@ProgrammersZone
@ProgrammersZone 2 жыл бұрын
Depends upon you, if you are into 1-2 year focus on codechef and codeforces and if you want to prepare for interviews do leetcode :)
@kunalpatil7473
@kunalpatil7473 2 жыл бұрын
Can someone give me full solution programm for this code please. I am Not able to run this in intellij idea.
@rishabhgurbani5235
@rishabhgurbani5235 2 жыл бұрын
how do we derive this formula? idea kaise aayega ki yeh formula banna chahiye?
@ProgrammersZone
@ProgrammersZone 2 жыл бұрын
Try different examples and you'll observe this I did the same
@amaanullah13
@amaanullah13 2 жыл бұрын
bro ab nhi dikha rha hai 99% faster abto 6% faster hi dikha rha hai sirf
@ProgrammersZone
@ProgrammersZone 2 жыл бұрын
Bro Time and Space Complexity par focus karo rest ye sab upar neeche chalta hai
@amaanullah13
@amaanullah13 2 жыл бұрын
@@ProgrammersZone okay 🤐 Bhai logic building mein dikkat aarhi hai😪. Kaise krein?
@aoodi-volt
@aoodi-volt Ай бұрын
bro
@ankitnishad7831
@ankitnishad7831 2 жыл бұрын
Everything was good till when you just put the formula and optimize the space i mean you haven't told how you approached that
@ProgrammersZone
@ProgrammersZone 2 жыл бұрын
Will make updated video with intution soon, at that time I was completely beginner so didn't have any idea of how to create videos :)
@chinmaysawant1343
@chinmaysawant1343 2 жыл бұрын
@@ProgrammersZone waiting for this or a link for article reference will also work. Thanks
Build Array from Permutation | Leetcode solutions - 1920
19:12
Algorithms Made Easy
Рет қаралды 11 М.
小路飞还不知道他把路飞给擦没有了 #路飞#海贼王
00:32
路飞与唐舞桐
Рет қаралды 87 МЛН
Why no RONALDO?! 🤔⚽️
00:28
Celine Dept
Рет қаралды 51 МЛН
How Much Tape To Stop A Lamborghini?
00:15
MrBeast
Рет қаралды 210 МЛН
touristream 011: Codeforces Educational 95
2:14:59
Gennady Korotkevich
Рет қаралды 110 М.
小路飞还不知道他把路飞给擦没有了 #路飞#海贼王
00:32
路飞与唐舞桐
Рет қаралды 87 МЛН