We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89879db commit e755505Copy full SHA for e755505
hackerRank/day30daychallange/hackerrank_day_10_30daysofcode.py
@@ -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