759. Convert Decimal to Binary Number

Given a non-negative decimal number N, convert it to its binary representation as a string.

Example 1:

Input: 15

Output: 1111

Explanation: Binary of 15 is "1111".

Example 2:

Input: 18

Output: 10010

Explanation: Binary of 18 is "10010".

Now Your Turn!

Pick the correct output for the given input

Input: 1023

Still unsure what the problem is asking ?

Let’s go through a few more examples, step by step, to make it clearer.

Constraints:

0 <= N <= 109

0
class Solution {
public:
string decimalToBinary(int N) {
// Your code goes here
}
};
 
Test Case

Input:

N