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.
I approached same this way
Order of operations can sometimes cause calculations to resolve in ways we did not mean for. Using parenthesis can nudge the program more in the direction you mean for it to calculate an answer instead of the ordinary precedence set by the language. This is a C# program, and you can read about C# precedence here: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/arithmetic-operators
Why are there "()" here?
easier
[updated wiki link](https://en.wikipedia.org/wiki/Guard_(computer_science)
No problem, you're welcome.
Right, now I can see my mistake, I was thinking exactly oposite(that there is right output is 2x^2).
English is not my native language, so I misunderstanded task)
Thank you for explaining, now I get it)
That means, the derivative of x^2 should be noted as 2x^1 instead of 2x. I think you didn't get that part.
Your code returns 2x^2 instead. That's why it is invalid.
It's from description:
..."^1" should not be truncated when exponent = 2.
Yes, it will pass, but it shouldn't. If it pass it doesn't mean "it's correct".
It passes, why do you say it won't? Have you tried it? Your code is wrong and it passed because random tests didn't generate a test with exponent = 2.
won't pass when exponent = 2
lol
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
It is little bit strange that this O(n^2) and another O(n^2) solution are marked as top rated best practices. Just below you can find O(n).
Loading more items...