Lazy Evaluation

  • + 0 comments

    The key take of Test case 3 is the order of checking if prime and palindrome.

    prime?(x) && palindrome?(x) # does not pass
    palindrome?(x) && prime?(x) # pass
    

    It's quite clever to check the less complex operation first