Arista Networks Interview Question

Question about finding missing number in an array containing sequential numbers. Code to find that number. Improved code to do the same