Write a method to compute the binary representation of a positive integer. The method should return a string with 1s and 0s.

**Note**: Use the minimum number of binary digits needed for the representation (Truncate unnecessary trailing 0s).

`computeBinary(6) ==> "110"`

`computeBinary(5) ==> "101"`

`computeBinary(5) ==> "0101" (incorrect)`

`computeBinary(5) ==> "101" (correct)`

Need a **hand?** Try out these hints, one at a time.

The key here is to divide the input by 2 and keep a track of the remainder at each step till the number itself becomes less than 2.

Recurse through the input number to break it down into its binary format.1. Check the input number. If it's less than 2, return its string equivalent.2. Else, return the concatenation of two recursive calls, i.e.

`input/2`

and `input%2`

as input paramters.
public static String computeBinary(int val) { }

**C**

**Java**

**Python**