6 kyu

SMS Lottery Bet Validator

411 of 818anter69
Description
Loading description...
Algorithms
  • Please sign in or sign up to leave a comment.
  • sadmarkus Avatar

    This comment has been hidden.

  • trashy_incel Avatar

    JavaScript:

    [7,7], "2   5 6  1, 7 , 3 4" -> null
    Expected: null, instead got: [1, 2, 3, 4, 5, 6, 7]
    

    what makes the string invalid here ?

  • Guntersteam Avatar

    Who can describe me what with that sequence is not OK? -(-_-) Test Failed Expected: null But was: < 4, 5, 10, 32, 35, 42 >

  • PapakhinaIrina Avatar

    fails this test. I don't understand what's wrong --->>>

    Unhandled rejection TestError: too much numbers and number greater than 'm' - Expected: null, instead got: [5, 18, 19, 22, 27, 32] Unhandled rejection TestError: too much numbers and number greater than 'm' - Expected: null, instead got: [5, 18, 19, 22, 27, 32

  • Krillan Avatar

    Ruby random tests

    ./spec/solution_spec.rb:32:in solver7879': undefined method to_set' for [1, 28, 33, 37, 47, 51, 61, 73]:Array Did you mean? to_s (NoMethodError)

    Random tests from fail without require 'set'. In this case, the set is not needed in the solution, and all solutions from the list of solutions do not pass.

  • apneck Avatar

    It seems like the python version of this kata is missing test cases for invalid characters that are not digits, spaces or commas.

  • user9644768 Avatar

    Ruby 3.0 should be enabled, read this to learn how to do it

    Please organize the structure of test fixture as following (although it has been mentioned in the attached link, I'm repeated here again)

    describe "<This message should describe the categories of test groups inside this block>" do
      it "<A short message describing this test group>" do
        expect(...).to eq(...) #Assertions
        #Or Test.assert_equals(user_response, reference_response)
      end
    end
    
  • visph Avatar

    Found a random test case with bad result expected (in Javascript translation), according to description and other fixed and random tests expected results:

    [6,6], "3 , 2 5 ,4 1,6" expect null

    ... anyway, attempting again to not encounter this case let pass the kata ^^

  • dcieslak Avatar

    C#

    N = 9 M = 89 
    text = 24,25,57,26,0,46,5,49,18,45 
    
    Expected: < 5, 18, 24, 25, 26, 45, 46, 49, 57 >
    But was:  null
    

    0 is not OK according to the description.

    N = 6 M = 44 
    text = 29  27  38  4  2  45  35 
    
    Expected: < 2, 4, 27, 29, 35, 38 >
      But was:  null
    

    45 is bigger than M = 44. It should return null.

  • myjinxin2015 Avatar

    C# The Expected and But was were exchanged. When I submit a solution like return null;, I got the following result:

    Test Results:
     Solution.SolutionTest
     FixedTests
    Expected: null
      But was:  < 1, 2, 3, 4, 5 >
    Completed in 0.028435ms
     RandomTests
    Expected: null
      But was:  < 4, 26, 27, 36, 39 >
    
  • Unnamed Avatar

    Some edge cases to think about:

    • leading and trailing delimiters: ,1 2, 1 2[space here] (I'm not sure if they are considered valid or not);
    • other space characters: 1\t2, 1 2\n;
    • other digit characters: 1 ² (or 1 \u00b2 since Codewars has problems with Unicode in Python);
    • plus signs: +1 +2.
  • ZozoFouchtra Avatar
  • Axesilo Avatar

    I added a C# translation. I pretty much ported over the Python tests exactly, except there are two new fixed tests to overcome the issue Blind4Basics mentioned.

  • Blind4Basics Avatar

    Hi,

    You should add fixed tests like these (my first solution slipped through the tests):

    [4, 90], "1 1 1 2 5 45"
    [6, 41], "5,22,18,65,32,19,27" (present in the random tests but not the fixed ones)