+ 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!:-)

32 ответов

+ 33

My one-liner in JavaScript
https://code.sololearn.com/WY324e59208k/?ref=app

+ 23

Finally my solution !! 😆
https://code.sololearn.com/cN8eOM4NhvUw/?ref=app

+ 23

https://code.sololearn.com/cfTqfPs5WU9H/?ref=app

+ 16

We finally started !! 👏😆👍
Thank you guys 👏😊😉
all of you !! 👍😆😎

+ 16

Here's my attempt : )
https://code.sololearn.com/cpmxMn383x6r/?ref=app

+ 15

@Pyctam
and ?!!!
I'm Bosnian 😆

+ 15

+ 15

@Russ
Make your code Public !! 😉

+ 14

Man... A little bit complicated, but here is my try.
Good challenge! ✌👍👌
https://code.sololearn.com/c31eOUW1noxR/?ref=app