This code is a trap for the unwary: the Big O of append is the
size of its first argument, but the size of the first argument is
growing as the loop progresses. This sets up a
Bermuda Triangle situation that
leaves our ship lost in an O(n2) whirlpool.