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.
The main idea here is to implement an efficient algorithm and that is to use the formula above. If the kata author really wanted to teach you the use of loops, the author would have passed in a list of numbers.
In my line of work I see way too many bindly implemented algorithms where the implementer does not worry about performance of the algorithm. I honestly think that performance of algorithms need to be taught (again), especially with big data (read: small improvements have big effects) and cloud computing (you pay per CPU time used)
I think it was in math class at middle school. I think the main idea here is to check if you can find a formula before blindly implementing an algorithm. In this case google "sum of sequence of numbers" and here is the story we were told in class https://letstalkscience.ca/educational-resources/backgrounders/gauss-summation.
Missed the point of the Kata but nicely circumvented the tests. Mac Guyveris still alive.
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 probly depends on the Database Management system. Can't say it for postgres. AFAIK, SQL server and DB2 don't care. I would use the on clause for joining the tables only and the where for limiting the result set.
\d is short for [0-9]
https://www.regular-expressions.info/shorthand.html
More: e and f must result only from sums (or differences) of products between on the one hand (a, b) and on the other (c, d).
[5600,19200] doesn't fit the bill if a=b=c=d=100.