Skip to content

Commit e755505

Browse files
authored
Add files via upload
1 parent 89879db commit e755505

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# -*- coding: utf-8 -*-
2+
"""Hackerrank day 10 / 30daysOfCode.ipynb
3+
4+
Automatically generated by Colaboratory.
5+
6+
Original file is located at
7+
https://colab.research.google.com/drive/1oPSz8qQaB9Xh-GhBomsZnZ-AUdPSqTv9
8+
"""
9+
10+
#!/bin/python3
11+
12+
import math
13+
import os
14+
import random
15+
import re
16+
import sys
17+
18+
if __name__ == '__main__':
19+
n = int(input())
20+
list = []
21+
22+
while n > 0:
23+
rm = n % 2
24+
n = n // 2
25+
list.append(rm)
26+
27+
count, result = 0,0
28+
29+
for i in range(0,len(list)):
30+
if list[i] == 0:
31+
count = 0
32+
33+
else:
34+
count = count + 1
35+
result = max(result,count)
36+
37+
print(result)

0 commit comments

Comments
 (0)