Utility Function to convert N to its binary representation
function convertToBinary ( n ) { let ans = " " ; while ( n > 0 ) { let rem = String . fromCharCode ( n % 2 + 48 ) ; ans += ( rem ) ; n = parseInt ( n / 2 , 10 ) ; } ans = reverse ( ans ) ; return ans ; }