Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nk = input().split()
- n = int(nk[0])
- k = int(nk[1])
- chapters = []
- for i in range(n):
- chapters.append(int(input()))
- canRead = True
- front = 0
- rear = n - 1
- while canRead:
- canRead = False
- if chapters[front] <= k:
- n = n - 1
- front += 1
- canRead = True
- if chapters[rear] <= k:
- n = n - 1
- rear -= 1
- canRead = True
- print(n)
Add Comment
Please, Sign In to add comment