Ad
  • Custom User Avatar

    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.

  • Custom User Avatar

    As I found out by trying it expects upper bound to be included (unlike the original kata).

  • Custom User Avatar

    In case you're still interested in this, I found out during some testing that rule on insert requires all values to be provided during insert to function correctly (at least in this particular case). This is not true here though, since the test code doesn't explicitly insert id'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).

  • Custom User Avatar

    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.

  • Custom User Avatar

    Read the description. It's not long.

  • Custom User Avatar

    You're not doing anything with UPDATE's and DELETE'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.