binaryAgent
Return an English translated sentence of the passed binary string.
Examples
binaryAgent('01001001 00100000 01101100 01101111 01110110 01100101 00100000 01001010 01100001 01110110 01100001 01010011 01100011 01110010 01101001 01110000 01110100') → 'I love JavaScript'
Starter code
function binaryAgent(str) {
}
Complexity of the optimal solution
Time O(n), space O(n). The process involves splitting the string (O(n)), mapping over the binary parts (where each `parseInt` is constant time for fixed-size binary strings), and joining. The overall time and space are proportional to the input string length n.