Missing Number | LeetCode 268 | Amazon Coding Interview Tutorial

preview_player
Показать описание
Missing Number solution: LeetCode 268

AFFILIATE LINKS
If you're interested in learning algorithms, these are great resources.

💲 All coupons and discounts 💲

Missing Number | LeetCode 268 | Amazon Coding Interview
#missingnumber #leetcode #algorithms #terriblewhiteboard #codinginterview

Click the time stamp to jump to different parts of the video.
00:00 Title
00:06 Problem readout
00:45 Whiteboard solution
03:47 Coding solution
06:56 Result and outro
Рекомендации по теме
Комментарии
Автор

If there are any videos you'd like me to make or if you have any ideas on how to optimize this solution, let me know!

TerribleWhiteboard
Автор

Yet another very beautiful explanation

aritralahiri
Автор

Your explanation is on another level entirely... very detailed..well done 👍

sharonb
Автор

bro u can also do with xor of [0, 1, 3] ^ [0, 1, 2, 3]

stepup
Автор

how does one figure this trick out with the indices? that difference of the sums of the array, gives this correct output? I think in an interview setting i would only be able to do the solution on leetcode which uses extra space

ninjaturtle
Автор

var missingNumber = function(nums) {
let numsLen =nums.length
let missingSum =0
let actualSum =numsLen*(numsLen+1)/2
for(let i=0;i<numsLen;i++){
missingSum+=nums[i]
}
return actualSum-missingSum
};

heyyyyyworld