Alright, it's time for some programming trick questions
-
-
Answer: just repopulate the array with new integers from 1 to N. Running time is O(N)
-
What's the fastest way to test whether a 32-bit integer is a perfect number?
- 5 more replies
New conversation -
-
-
for i in range(n): array[i] = i + 1
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
make a new array and fill it with a for loop
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.