Ad
  • Default User Avatar

    Nahhh. Been coding in many languages.

  • Default User Avatar

    Why use IF EXPRESSION THEN BOOLEAN when all you need is EXPRESSION?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I think you're mis-reading the logs. There are two test cases right after each other, both of them are correct:

    Test.assert_equals(score_hand(['A','A','A','J']), 13)
    Test.assert_equals(score_hand(['A','2','A','9','9']), 22)
    
  • Default User Avatar

    I have the same problem, and card was:
    A
    2
    A
    9
    9

    I use pritn to show what is in cards

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Well complexity of your code is O(n^2) of both the loops and you are using two list methods too i.e., count and remove which i guess having a complexity of O(n) linear time.. so for better case, you can easily decrease the complexity of your code

  • Default User Avatar

    Simply, if you can count an A as 11 points, and after adding other cards' scores, total score stays at 21 or less, you should do it. Otherwise count it as 1. It's hard to get more specific without revealing too many details =/

  • Custom User Avatar

    Click over Blackjack link in the kata description to read the wikipedia article. It's by choice.

    ["A", "J"]                      ==>  21 <- "A" here is chosen to be an 11 
    
  • Custom User Avatar

    The description for this Kata isn't clear. Especially in the case where A can be 1 or 11? How? I tried figuring it out on my own, but I wasn't able to

  • Custom User Avatar

    You'll have to insert something into your code to see the parameters they're using for testing. Maybe print the inputs?
    Regarding this test, if 13 is a possible total given the cards available, then you should return 13 and not 23, because the instrauctions say: "Return the highest score of the cards that is less than or equal to 21."

  • Custom User Avatar

    23 should equal 13
    is this?? i don't get what are the parameters they are using for testing

  • Default User Avatar

    Approved

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Description cannot be approved, recent changes from related record must be merged first.

  • Loading more items...