Hackerrank 30 days of code Java Solution: Day 10: Binary Numbers

The next problem is based on Binary numbers.The number to binary conversion and vice versa is the motive of this day. Again I would recommend to watch the tutorial for this lesson, it will brief you about the mathematics involved in conversion.

Task
Given a base-10 integer,n , convert it to binary (base-)2. Then find and print the base- integer denoting the maximum number of consecutive ‘s in ‘s binary representation.

Sample Input

Sample Output

Sample Input

Sample Output

So here the Solution you have landed here for..

Hope you like the post.. 🙂

One Comment

  1. Your opinion on options differs from most of the blogs I browse, I’m pleased.

Leave a Reply

Your email address will not be published. Required fields are marked *