Question d’entretien chez Meta

write a function that gets 2 strings. every string represent a binary number. the function should return a string that contain the sum of the two numbers also in binary.

Réponse à la question d'entretien

Utilisateur anonyme

21 déc. 2015

function test(s1, s2){ return (parseInt(s1, 2)+parseInt(s2, 2)).toString(2); } console.log('answer', test('101', '001');