Ad
  • Custom User Avatar

    "increasing" and "decreasing" should be specified better. ATM, testing is so limited it allows for solving with a third category "constant" - this may or may not even be intentional.

  • Custom User Avatar

    Needs random test cases, refer to this for examples :)

  • Custom User Avatar

    Needs random test cases

  • Custom User Avatar

    Similar to the "Overlapping Ranges" kata, please use the Test.assertEquals method. This at least makes it easy to see what the error was.

    Another suggestion is I highly recommend wrapping your tests in describe and it blocks (in both Katas). This enables more than one test to run before bailing.

    BTW: bkaes has put together an amazing document about writing good Katas. Definitely worth a read!


    Also, I believe the answer for this test is off-by-one. It states the index should be 3, but at the index 3 we're still increasing:

    idx:  0   1   2   3   4   5   6
    arr:  1   2   4   6   4   3   1
    dir:    +   +   +   -   -   -
    

    It is a matter of opinion as to where the result should be, but it really seems like the first number that changes the pattern is at index 4.

  • Custom User Avatar

    Your description of the problem doesn't match the expected solution or code setup (it says you'll receive an array, but 5 unique arguments are passed in).

    There's also no example test cases, which doesn't help.