From e6cdf94fc5e025d18b29214b6f6b7848fba5c0ba Mon Sep 17 00:00:00 2001 From: Kacper Kruczek Date: Fri, 29 Jun 2018 19:52:23 +0200 Subject: [PATCH] 02 input fix --- 02-rozwiazanie.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/02-rozwiazanie.js b/02-rozwiazanie.js index 10237a3..2af6f2b 100644 --- a/02-rozwiazanie.js +++ b/02-rozwiazanie.js @@ -2,10 +2,11 @@ let Polynomial = require('./polynomial.js'); let mul, div, gcd; function parseArray(x) { + let stringResult = ""; result = Array.from(x).filter(x => { - if (x == ' ' || x == '[' || x == ']' || x == ',') return false; + if (x == ' ' || x == '[' || x == ']') return false; else return true; - }).map(x => parseInt(x)); + }).join('').split(',').map(x => parseInt(x)); return result; }