#318 Finding the Missing Number in an Array

Companies:
Sberbank
Themes:
AlgorithmsArraysPractice

An array contains an unordered sequence of numbers from 1 through 100 with one random number missing. How can the missing number be found?

public static int findMissingNumber(int[] array) {
    ...
}

Question review

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in