Categorygithub.com/vahidpi/golangfind_the_Missing_Number
package
0.0.0-20240518074055-99488ac300e2
Repository: https://github.com/vahidpi/golang.git
Documentation: pkg.go.dev

# README

Find the Missing Number

You are given an array of positive numbers from 1 to n, such that all numbers from 1 to n are present except one number ‘x’. You have to find ‘x’. The input array is not sorted.

For example, let’s look at the below array.

n=8
A[]int={3,7,1,2,8,4,5}
Missing number = 6

Hint How would you calculate the sum of numbers from 1 to n?