A Babel of Languages on CodinGame
TBali
58.4K views
Dart
Checking the sample code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import 'dart:io';
import 'dart:math';
void main() {
// String m = stdin.readLineSync();
String m = "CG";
var c = {0 : "00", 1: "0"};
String b = "";
for(int i = 0; i < m.length; i++) {
b = b + m.codeUnitAt(i).toRadixString(2).padLeft(7, "0");
}
String a = "";
a += c[b[0].codeUnits.first - "0".codeUnits.first] + " 0";
for (int i = 1; i < b.length; i++)
if (b[i] == b[i - 1])
a += "0";
else
a += " " + c[b.codeUnitAt(i) - "0".codeUnits.first] + " 0";
print(a);
}
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.
Suggested playgrounds