• + 0 comments

    I have used two for loops in my solution and it failed in four test cases due to time complexity.you used one while and for loops but it turned out it is error clear how is this happening,what is the principle in time complexity.

    scores=list(map(int,input().split())) alice=list(map(int,input().split())) climberank=[] for i in alice: temp=set(sorted(scores)) temp.add(i) for index,value in enumerate(sorted(temp,reverse=True),1): if value==i: climberank.append(index) temp.discard(i) print(*climberank)