package
0.0.0-20241209140624-9fce2a725d55
Repository: https://github.com/elven9/my-leetcode.git
Documentation: pkg.go.dev

# README

Missing Numbers

Solution IdxTime ComplexitySpace ComplexityComment
1O(n*logn)O(1)Sort w/ linear scan or binary search
2O(n)O(1)Xor each w/ index of nums
3O(n)O(1)Add nums[i] and substract i, get the difference
4O(n)O(1)Indexing Sort

Sol 3 is actually faster in terms of runtime difference.