• + 1 comment

    what is the issue in my code I am getting time limit exceed.

    def gamingArray(arr): count =0 arrlen = len(arr) for i in range(arrlen): if len(arr)>0: idx=arr.index(max(arr)) arr=arr[:idx] count+=1 winner = "ANDY" if count % 2 == 0 else "BOB" return winner