I am working on a kattis problem, where I am suppose to take the input in prefix notation, simplify it and return it in prefix notation as well. This are the examples of inputs and outputs: Sample Input 1 Sample Output 1 + 3 4 Case 1: 7 – x x Case 2: – x […]

Categories

## Javascript – Simplification of prefix notation

- Post author By Full Stack
- Post date November 29, 2019
- No Comments on Javascript – Simplification of prefix notation

- Tags '-', '*', '/']; const operatorsFunctions = { '+': (a, (line) => { const mathExpression = line.split(' '); lineNumber += 1; let result = []; for (let i = 0; i < mathExpression.le, }; let lineNumber = 0; rl.on('line', a, and if I run it with this kind of input data, b) => a + b); }, I am working on a kattis problem, I get exactly the same output as stated up above. Yet, I get wrong answer from Kattis. What is it that I am doing wrong here? It is frustrating since you get no debugging hints. const readline =, output: process.stdout }); const operators = ['+', parseInt(nextExpression)).toString(); i++; } } else { result.push(mathExpress, simplify it and return it in prefix notation as well. This are the examples of inputs and outputs: Sample Input 1 Sample, where I am suppose to take the input in prefix notation