We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

- Practice
- Tutorials
- LinkedIn Placements
- Consecutive 1's in Binary Numbers

# Consecutive 1's in Binary Numbers

# Consecutive 1's in Binary Numbers

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

**Input Format**

A single integer, .

**Constraints**

**Output Format**

Print a single base- integer denoting the maximum number of consecutive 's in the binary representation of .

**Sample Input 1**

```
5
```

**Sample Output 1**

```
1
```

**Sample Input 2**

```
13
```

**Sample Output 2**

```
2
```

**Explanation**

*Sample Case 1:*

The binary representation of is , so the maximum number of consecutive 's is .

*Sample Case 2:*

The binary representation of is , so the maximum number of consecutive 's is .