Ad
  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    This is pedantic but the description does say:

    Create a function ... that accepts two parameters

    Although the test cases doesn't test for the amount of parameters, this solution would technically be incorrect as it accepts 0 to N parameters.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    The wording of the description was a bit unclear. It took me a while to understand.
    Maybe its just me, but reading that it should return True if your friend can figure out you are fooling him implies that False would mean that your friend can't figure out you are fooling him, but the description provides an example where you don't even try to fool him.

    I'd add a another example where it returns False but because your friend can't figure out that your fooling him, like the test "ping","pong", ["p","n","g"]

  • Custom User Avatar

    I don't like too much this implementation. It has multiple calls to .index() which from my understand will iterate over the deck lists until it finds the element. So worst case scenario, it iterates over the same list 4 times. In this case the deck list is short so performance is no problem but it could become a problem with longer lists of cards.

  • Default User Avatar

    @domingomesajr but it passed the tests, so there is no error.

  • Default User Avatar

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

  • Default User Avatar

    That really depends on the length of the strings you are going to be processing and your hardware, but now a days memory is cheap. The context of this problem is comments, there is usually a character limit, let's say you have a 1000 character limit, Then at best you'll be allocating 1kB for the comment and another 1kB for the answer, thats 2kB total. On the other hand if you count the number of non-vowel characters you are going to check the string twice no matter what and in the worst case scenario you are going to be allocating 2kB either way if the comment doesn't contain any vowel. It's a trade off, you are saving a little bit of memory for processing power.