Ad
  • Custom User Avatar
  • Custom User Avatar
    1. You need to return a Boolean value instead of a string representation of a Boolean value. Therefore, you don't need String
    2. You need to state what input the regex will be testing for (use the self reserved word). Otherwise the regex will automatically return false.
  • Custom User Avatar

    Two reasons.

    1. count only accepts one string as an argument.

    2. ('x' && 'X') evaluates to false, so you are essentially saying str.count(false).