Guest User

Untitled

a guest
Oct 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. def solution(array):
  2. head_count = 0
  3. tail_count = 0
  4. for i in array:
  5. if i == 0:
  6. head_count += 1
  7. else:
  8. tail_count += 1
  9. if head_count<= tail_count:
  10. return head_count
  11. else:
  12. return tail_count
Add Comment
Please, Sign In to add comment