Back
Close

A Babel of Languages on CodinGame

TBali
68.1K views

TypeScript

TypeScript

Checking the sample code

const m: string = readline();
var c: string[] = ["00", "0"];
var b: string = "";
for (let w of m)
    b = b.concat(parseInt(w.charCodeAt(0).toString()).toString(2).padStart(7, '0'));
var a: string = c[b.charCodeAt(0) - "0".charCodeAt(0)] + " 0";
for (let i = 1; i < b.length; i++) {
    if (b[i] === b[i - 1])
        a = a.concat("0");
    else
        a = a.concat(" ", c[b[i].charCodeAt(0) - "0".charCodeAt(0)], " 0");
}
console.log(a);
// To debug: console.error('Debug messages...');

Looking at the syntax

  • TODO

Other characteristics

  • TODO

Resources to check

Coming next...

Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io