You are viewing a single comment's thread from:
RE: Coding Challenge #2 – Polynomial
Haha, you said the next challenge would be a bit harder than FizzBuzz, but this is quite the brain teaser. I'm not even sure if I'm going to fully implement it, but I'm working on a solution that's definitely going to take me a while.
Expect a post about it though, it's definitely good practice and I'm having fun solving this one.
My main problem right now is parsing the input and output in more loose styles, omitting things like x^0
.
A few tips: Only the first + can be omitted, so after that a + or - is a delimiter. if no x is present, use x^0 and if x is present, use x^1.
so I would first split by +I- and then work on each number. If you want to allow x^{-1} then ignore +I- inside {}. Each number can be split at the x and the left part is the number, the right part (if exist) the x^y.
I'll be keeping this challenge on for a bit so you have time to complete it :)
Thanks for the hints! I actually got the input parsing solved already, clean output is almost done but I'm moving on to the problem of adding now. Making progress :)
Thanks....... upvote and follow