Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for i in range(len(n) - 1):
- if n[i] >= n[i+1]:
- nonspecialval = n[i]
- nonspecialindex = i
- lefthalf = n[:nonspecialindex]
- righthalf = n[nonspecialindex:]
- nonspecialdamage = 1
- for k in range(len(x)):
- if k > nonspecialindex and n[k] < nonspecialval:
- nonspecialdamage += 1
- leftcurrindex = 0
- rightcurrindex = 0
- leftcounter = 1
- leftdamages = []
- rightdamages = [1] * len(righthalf)
- while True:
- if leftcurrindex > len(lefthalf) - 1:
- break
- if lefthalf[leftcurrindex] > righthalf[rightcurrindex]
- leftcounter += 1
- rightcurrindex += 1
- else:
- leftcurrindex += 1
- leftdamages.append(leftcounter)
- damages = leftdamages + [nonspecialdamage] + rightdamages
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement