Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Untitled
a guest
Oct 19th, 2018
93
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
text
0.26 KB
| None
|
0
0
raw
download
clone
embed
print
report
def solution(array):
head_count = 0
tail_count = 0
for i in array:
if i == 0:
head_count += 1
else:
tail_count += 1
if head_count<= tail_count:
return head_count
else:
return tail_count
Add Comment
Please,
Sign In
to add comment
Public Pastes
ir lib remote
Arduino | 8 min ago | 4.04 KB
periodeservice.js
PHP | 17 min ago | 13.26 KB
periode.php
PHP | 21 min ago | 12.94 KB
Admin_periode.php
PHP | 25 min ago | 6.08 KB
🤑 G2A.com Free Gift Card Guide May 2024 FIX 🤑
GetText | 51 min ago | 0.39 KB
Maximum Level Sum of a Binary Tree
C++ | 1 hour ago | 1.33 KB
Untitled
YAML | 1 hour ago | 0.63 KB
converte-webp-2-jpg-e-apaga-os-webp
Python | 1 hour ago | 1.47 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!