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.
Mr.Obvious :D
That's true, but there is no better way to do it, short of resorting to a higher-precision floating-point type.
You forgot for double inprecision, basicly floating-point arithmetic, not a good idea.
Something ain't right when 2 comes before n haha.
Nice practice.
Exactly as Jotha said, that was my reasoning. Return does the same as break here.
This comment is hidden because it contains spoiler information about the solution
The ol' reliable baby!
first you get dry content, which is constant(w0 * (100 - p0)), then we convert back to full weight by using reversal operation with new percentage
Can someone explain please? I'd really appreciate it.
nice!
Checking for sum of [1,2,...n] is NOT enough for a perfect solution,
eg. your program gives True for
{ 5,5,5 5,5,5 5,5,5 }
{ 5,5,5 5,5,5 5,5,5 }
{ 5,5,5 5,5,5 5,5,5 }
{ 5,5,5 5,5,5 5,5,5 }
{ 5,5,5 5,5,5 5,5,5 }
{ 5,5,5 5,5,5 5,5,5 }
{ 5,5,5 5,5,5 5,5,5 }
{ 5,5,5 5,5,5 5,5,5 }
{ 5,5,5 5,5,5 5,5,5 }
which obviously is an invalid sudoku of 1,2,...,9
(but it does have sum of 45 in every row, column, and small square)
You have to make statistics of the occurred elements too to determine if the solution is valid.
The fastest way i know of.
nice
Jotha gave you the best explanation. Also check on Mozila website for javascript documentation ;)
Loading more items...