+ 40

[ ASSIGNMENT: ] Binary Numbers

Given a base-10 integer, n, convert it to binary (base-2). Print a single base-10 integer denoting the maximum number of consecutive 1's in the binary representation of n. Sample Input : 5 Sample Output : 1 The binary representation of 5 is 101, so the maximum number of consecutive 1's is 1. Sample Input : 13 Sample Output : 2 The binary representation of 13 is 1101, so the maximum number of consecutive 1's is 2. HappyCodings!:-)

24th Jan 2018, 2:53 PM
Danijel Ivanović
Danijel Ivanović - avatar
32 ответов
24th Jan 2018, 5:37 PM
LukArToDo
LukArToDo - avatar
25th Jan 2018, 2:13 AM
Swapnil Srivastava
Swapnil Srivastava - avatar
+ 23
24th Jan 2018, 7:03 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 23
https://code.sololearn.com/cfTqfPs5WU9H/?ref=app
24th Jan 2018, 10:41 PM
Danijel Ivanović
Danijel Ivanović - avatar
25th Jan 2018, 12:54 PM
Justine Ogaraku
Justine Ogaraku - avatar
+ 16
We finally started !! 👏😆👍 Thank you guys 👏😊😉 all of you !! 👍😆😎
24th Jan 2018, 5:31 PM
Danijel Ivanović
Danijel Ivanović - avatar
25th Jan 2018, 7:29 AM
Ipang
+ 15
@Pyctam and ?!!! I'm Bosnian 😆
24th Jan 2018, 3:02 PM
Danijel Ivanović
Danijel Ivanović - avatar
25th Jan 2018, 6:56 AM
Mahdi Cheikhrouhou
Mahdi Cheikhrouhou - avatar
+ 15
@Russ Make your code Public !! 😉
28th Jan 2018, 8:51 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 14
Man... A little bit complicated, but here is my try. Good challenge! ✌👍👌 https://code.sololearn.com/c31eOUW1noxR/?ref=app
24th Jan 2018, 5:16 PM
Fabio