LeetCode Weekly Contest 248 Question 1: Build Array from Permutation

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Bro WTF, question asked us to do in O(1) space

nemesis_rc
Автор

Nicely explained. Appreciate it.
Algo
1.make an answer array or vector
2.traverse through the entire array and
Perform ans[i]= nums[nums[I]] and return ans array

raihanmdsiqbal
Автор

You should've made the video in O(1) time complexity

sikandsandhu
Автор

Thank you, I was overthinking this problem :-) Now it makes sense

riceball
Автор

Really simple explanation. Thank you so much!!

hercules
Автор

Bad explanation, without even reading the whole problem.
We are asked to solve it in O(1) space complexity

SumitSharma-cqcf
Автор

Please don't call yourself Coding Ninja again
just please...

arghadeepmisra
join shbcf.ru