diff options
| author | Omar Magdy <omar.professional8777@gmail.com> | 2022-05-06 01:23:31 +0200 |
|---|---|---|
| committer | Omar Magdy <omar.professional8777@gmail.com> | 2022-05-06 01:23:31 +0200 |
| commit | bfd47647651229dd98734db1b1ef6bdc55dd65d3 (patch) | |
| tree | d953e7023dfa79228aef8819fa1279f76f0dfd87 /05-05-2022(Div.3)/C/C.py | |
| parent | 5c3d5f3e83a0113f6fb739ca63389c94232b5adf (diff) | |
| download | competitive-programming-bfd47647651229dd98734db1b1ef6bdc55dd65d3.tar.xz competitive-programming-bfd47647651229dd98734db1b1ef6bdc55dd65d3.zip | |
Solved C in div3 05-05-2022
Diffstat (limited to '05-05-2022(Div.3)/C/C.py')
| -rwxr-xr-x | 05-05-2022(Div.3)/C/C.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/05-05-2022(Div.3)/C/C.py b/05-05-2022(Div.3)/C/C.py new file mode 100755 index 0000000..422b0f7 --- /dev/null +++ b/05-05-2022(Div.3)/C/C.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 + +t = int(input()) +while(t): + t-=1 + s = input() + one = 0 + zero = len(s) - 1 + for i in range(len(s)): + if s[i] == '0': + zero = i + break + for i in range(len(s)): + if s[i] == '1': + one = i + print(zero - one + 1) + |
