n00m wrote: > Oh! > Seems you misunderstand me! > See how the last block in your code should look: > > for tc in range(10): > _ = stdin.readline() > sequence = [int(ch) for ch in stdin.readline().split()] > supers = supernumbers(sequence) > print len(supers) > for i in supers: > print i,
Ah, I misunderstood the input. I thought they'd run it once for each of their test cases. Handling exactly ten inputs sucks, so how about: while True: if not stdin.readline().strip(): break sequence = [int(ch) for ch in stdin.readline().split()] supers = supernumbers(sequence) print len(supers) for i in supers: print i, print -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list