Skip to content

Instantly share code, notes, and snippets.

View bondom's full-sized avatar

Yurii Fediv bondom

View GitHub Profile
a. - dir men des
b. - dir men segiz
c. - oš pen eki
d. - vört pen ževi
e. - ževi den elüx
f. - segiz men elüx
g. - ün oš pen ovız
h. - ovız den eki
i. - elüx eki men ün
function printTree(stringTree) {
function parseTree(stringTree) {
if (stringTree[0] === '(' && stringTree[stringTree.length - 1] === ')') {
const body = stringTree.slice(1, stringTree.length - 1);
const splitterIndex = body.indexOf(' ');
const header = body.slice(0, splitterIndex);
const children = body.slice(splitterIndex + 1);