5 ms·
The input set is problematic because it contains every number from 0 to VA.length exactly once. This allows "algorithms" like this: for x in [0...VA.length]
by ginkgo 15y ago
The input set is problematic because it contains every number from 0 to VA.length exactly once.
This allows "algorithms" like this:
for x in [0...VA.length]
while (VA.get(x) > x)
VA.swap(VA.get(x), x)
- thedufer 15y agoIts not a game; its a learning tool. It doesn't bother me that people can do that. Also, that's not going to work quite right - the values are [1..VA.length] (see the bottom of the page), while the indices are [0...VA.length].