Gaming Array 1

  • + 0 comments

    Python 3

    def gamingArray(arr):
        last = 1
        curr_max = arr[0]
        for number in arr[1:]:
            if number > curr_max:
                curr_max = number
                last += 1
        return "ANDY" if last % 2 == 0 else "BOB"