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.
It's all laid out in the Description. I don't know how much more clear it can be.
Output:
Your function must return the number of valid upside down numbers within the range of the two input arguments, including both upper and lower bounds.
As I found out by trying it expects upper bound to be included (unlike the original kata).
In case you're still interested in this, I found out during some testing that
rule on insert
requires all values to be provided duringinsert
to function correctly (at least in this particular case). This is not true here though, since the test code doesn't explicitly insertid
's, relying on that column's autoincrement capability instead.I've added a note hinting towards this fact instead of modifying the tests because the original idea behind this kata was to use "t", and I'd like it to remain that way (plus, it's more realistic, since normally people don't provide values for autoincrementing primary key columns, making
rule
a not 100% correct choice).It should be an acceptable algorithm, but it depends on the regex engine (and, indirectly, the language) used. Some engines have limitations related to amount of groups, or performance of backtracking quantifiers. Try to optimize your resulting expression a bit, use non-capturing groups or eager, non-giving back quantifiers, and it might help. Some totally unoptimized expressions generated by my Java solution can be measured in large kilobytes, but they still pass. But for other languages, I believe they might not.
Read the description. It's not long.
You're not doing anything with
UPDATE
's andDELETE
's. I don't know how the thing you're trying to use works, but it also gives incorrect results when I compare it to my solution.