daily pastebin goal
27%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def solution(num_str):
  2.     zeros = ones = 0
  3.     for i in range(len(num_str)):
  4.         num = num_str[i]
  5.         if num == "0": zeros += 1
  6.         else: ones += 1
  7.         if ones>1 and zeros>1: break
  8.     if zeros == 1 or ones == 1: print("YES")
  9.     else: print("NO")
RAW Paste Data
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
 
Top