Modify the array to store the existence of possible number, O(n), AC