Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Hmm, seems this kata is in limbo. Description has multiple spelling issues. I find the names of the data structure misleading, even a Wikipedia link does not help that much. The argument to the function is a basically an array, so please use C arrays, that helps to understand what's happening.
At this point this kata is basically a duplicate of a mixture of katas:
It's not clear if the possible root to check is always the first vertex or it can be any.
Damn, it's been AGES since I've written any C code!
I liked this kata, but I see following issues:
GRAPHS
as a tag?Int(ax^n) = a/(n+1)x^(n+1)
)."Don't forget coeficients can be negative."
to"Don't forget coefficients can be negative or fractional."
. I know it's very logical that in general coefficient can be any real number, but examples slightly suggest they may be just integers in this kata.roundf
a bit of a stretch? This way, both of these pass:dotest('y', 0, 1, " y^7 + 2y^4 + 1 -y^7 ", 1.4);
anddotest('y', 0, 1, " y^7 + 2y^4 + 1 -y^7 ", 0.6);
. My implementation can return anything between 0.5 and 1.5 and test will still pass. Isn't epsilon-based comparison better?There are pictures of both directed and undirected graphs in the description, what is expected is not really clear. As I can see, the list of edges is not symmetrical, so it looks like the graphs are directed. So should it be checked that all the edges point either from or to the root?
This comment is hidden because it contains spoiler information about the solution
Duplicate:
https://www.codewars.com/kata/valid-parentheses
https://www.codewars.com/kata/are-the-brackets-balanced