Find the Missing Number | CS interview question | Gauss Sum Method
IONHowTo
Computer science job interview question: Find the missing number in the series. Write a program to calculate the missing number in the series of integers. Using the Gauss Sum addition method is a nice trick and it's faster than any brute-force iteration you might think of. More info https://en.wikipedia.org/wiki/Gauss_sum
The idea is that you take the count of elements you have including the missing number and add 1 to that then divide it by 2. This is a nice way to write some leetcode or leet-code 1337 and pretend you know what you're doing. https://en.wikipedia.org/wiki/Leet
n*(n+1)/2
In the video you will see why you need to add the +1 there and why this works.
Join this channel to get access to perks: https://www.youtube.com/channel/UCx4Qbp3iC97kQzj7e7g7slg/join
SUBSCRIBE and CLICK the BELL to be notified. DIY Projects https://rex.red/diro RedNumberONE https://rex.red/rno
Buy T-Shirts https://rex.red/ditees
Check it out, buy it, post it online and
tag it #dragoswefixit
Any questions? Feel free to ask in the comments section bellow. Subscribe, Like and SHARE!
Join us Twitter: https://twitter.com/dragosion Website https://diy.rednumberone.com Food Recipes: https://www.rednumberone.com/ ... https://www.youtube.com/watch?v=dHjVpDxJBWQ
18661037 Bytes