I believe term is another thing all together. A polynomial consists of terms seperated by mathematical operators. I guess expreession could be a better word.
Actually not as arr.slice() methods 2nd argument is not inclusive, so for each of the arr.slice(i,j) the array is sliced from index i to j-1, thats why there's no error thrown
How does this work, the kata clearly has a limit on the number of letters per lines and number of lines...
This happens because the curried function doesnt return a primitive value.
Yeah i guess lowest assesment of 5kyu for this kata was pretty accurate
I believe term is another thing all together. A polynomial consists of terms seperated by mathematical operators. I guess expreession could be a better word.
Actually not as arr.slice() methods 2nd argument is not inclusive, so for each of the arr.slice(i,j) the array is sliced from index i to j-1, thats why there's no error thrown
Just regular flags and loops at work, without any fancy array manipulations. Great work!!!
Elegant Solution
This comment is hidden because it contains spoiler information about the solution
This is quite similar to donaldsebleung's solution, but not as cryptic...
Short, concise and elegant.
Real clever :) But its gonna work only for those two inputs
Since I dont yet know regex yet that well this solution was the better one, albeit a bit verbose.
The actual documentation specified by the language would be the safest bet
An Elegant solution without using any extenal API's.