You are viewing a single comment's thread. Return to all 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
Seems like cookies are disabled on this browser, please enable them to open this website
Lazy Evaluation
You are viewing a single comment's thread. Return to all comments →
The key take of Test case 3 is the order of checking if prime and palindrome.
It's quite clever to check the less complex operation first