School Accuracy: 34.52% Submissions: 139 Points: 0

Write a program to print Binary representation of a given number N.

Example 1:

Input:
N = 2Output:
000000000000000000000000000010Explanation:
The binary representation of 2 is '10'
but we need to print in 30 bits so append
remaining 0's in the left.

Example 2:

Input:
N = 5Output:
000000000000000000000000000101Explanation:
The binary representation of 5 is '101'.

Your Task:
You don't need to read input or print anything. Your task is to complete the function getBinaryRep() which takes an Integer N as input parameter and returns a string of size 30 which is the binary representation of N.

Expected Time Complexity: O(LogN) Expected Auxiliary Space: O(1)