1. 程式人生 > >Practice Go: Missing Numbers @ Alex Pliutau's Blog

Practice Go: Missing Numbers @ Alex Pliutau's Blog

Given an array containing all the numbers from 1 to n except two, find the two missing numbers.

Example

  • missing([]int{4, 2, 3}) = []int{1, 5}
  • missing([]int{1, 2, 3, 4}) = []int{5, 6}

Run tests with benchmarks

go test -bench .