Hellom n00m!
I beg your pardon for not having replied for such long time---I was
really busy.
Yes, the posted code doesn't solve the supernumbers problem, but solves
the problem you posted first as I understood it :) --- for each number
find a position of this number in the longest sequence it be
I hope nobody have posted similar solution (it's tested, but I didn't
submit it to contest):
from bisect import bisect_right as find
def supernumbers(ls):
indices = [0]*len(ls)
for i, e in enumerate(ls):
indices[e - 1] = i
result = [None]*len(ls)
borders = []
for i in indices: