All Problems

Problem title

Difficulty

Avg time to solve

Largest sub-tree sum

Easy

15 mins

Reversing Series Pattern

Easy

15 mins

Equal Sum

Easy

15 mins

Pattern: Triangle of numbers

Easy

15 mins

Binary Confusion

Easy

10 mins

Minimum Falling Path Sum

Moderate

25 mins

Ways to Arrange Balls

Hard

40 mins

Longest Palindromic Subsequence

Hard

45 mins

Find prime numbers

Easy

15 mins

Minimum Character Deletion

Moderate

15 mins

Problem

Submissions

9

Avg. time to solve

10 min

Success Rate

90%

Problem Statement

```
The first line of input contains an integer ‘T’ denoting the number of test cases. The test cases follow.
The first line of each test case contains a single integer ‘N’, given to Ninja and his friends.
```

```
For each test case, print the binary equivalent of the given number.
Print the output of each test case in a separate line.
```

```
You are not required to print the expected output; it has already been taken care of. Just implement the function.
```

```
1 <= T <= 10 ^ 3
0 <= N <= 10 ^ 6
Time Limit: 1 sec
```

```
2
10
7
```

```
1010
111
```

```
In the first test case, the value of ‘N’ is 10, so:
1) Remainder when ten is divided by 2 is zero.
2) Divide ten by 2. New number is 10/2 = 5.
3) Remainder when five is divided by 2 is 1
4) Divide five by 2. New number is 5/2 = 2.
5) Remainder when two is divided by 2 is zero.
6) Divide two by 2. New number is 2/2 = 1.
7) Remainder when one is divided by two is 1.
8) Divide 1 by 2. New number is 1/2 = 0.
Since the number becomes = 0, break out of the loop. So the final answer is the reverse of all the remainders obtained which is 1010.
In the second test case, ‘N’ is 7, and we apply similar steps as given above.
The final answer comes out to be 111.
```

Sample Input 2:

```
2
12
33
```

```
1100
100001
```

Java (SE 1.8)

Console

Sample Test Case

Custom Test Case

Download Test Cases

Test Case 1

Test Case 2

Test Case 3

Saving Code...

Full Screen Mode

Change Theme

Solution submission not allowed

Save Code

Reset Code