Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-robot77 committed Jun 26, 2023
1 parent 4929e17 commit 70a78eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Python/ch2.String/hard_counting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print(f'{int(input()):b}'.count('1'))
8 changes: 8 additions & 0 deletions Python/ch2.String/pass.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
k = int(input())
password = input()
def co(ch, s):
i = s.find(ch)
return min(i , len(s) - i)
res = 0
for i in range(k): res += co(password[i] , input())
print(res)

0 comments on commit 70a78eb

Please sign in to comment.