Ad
  • Custom User Avatar

    Fixed (you need to reset the trainer to see the fix).

  • Default User Avatar

    How do you know if you're using functional approach? is it when you use advanced methods like composition, currying and partial application? Because from what I know, applying the principles are enough to be considered as functional (Immutability, Higher-order & first-class function, referential transparancy, etc).

    If the advanced methods are not required, then you don't have to use it.

  • Default User Avatar

    Yeah, It's kinda sad that people don't cheat not because it's not allowed, but because they can't.

  • Default User Avatar

    I tried your solution and got that:

    *NoSuchMethodError: The method 'sort' was called on null.
    Receiver: null
    Tried calling: sort()
    

    I also tried several recent solutions and they all worked fine so the problem is in your code: you are sorting a null list... AFAIK Null Safety is from 2.12 and the version used by CW is 2.8 so there is no problem in the kata with Null Safety.

  • Custom User Avatar

    The actual test that fails is for solution("abc","")

    I don't think that's what happens. Your solution should pass this test case correctly. But it fails for following test cases:

    It(Sample_Test_Cases_1)
    {
      Assert::That(solution("a(b)", "(b)"), Equals(true));
    }
    It(Sample_Test_Cases_2)
    {
      Assert::That(solution("a(b)", "b)"), Equals(true));
    }  
    It(Sample_Test_Cases_3)
    {
      Assert::That(solution("a(b", "(b"), Equals(true));
    }  
    

    Basically, you turned the problem into two problems ;)

  • Custom User Avatar

    BTW I'm not sure if I got you right, but if you are trying to use regex and you try to use input argument as a (part of) regex pattern, then there's one particular aspect you need to handle, or otherwise you will get errors related to syntax of the expression.

  • Custom User Avatar

    could you post your code here? the one you think is correct but Codewars says its not?