Quantcast
Channel: silk and spinach » kata
Viewing all articles
Browse latest Browse all 12

today’s kata

$
0
0

In Ruby, one easy way to check for palindromes would be to write a method such as this:


class String
 def palindrome?
   self == self.reverse
 end
end

But the C++ part of my brain screams that this is likely to be very inefficient. So, today’s kata: test-drive a palindrome? method for String, ensuring (with tests) that it is much faster than the above.



Viewing all articles
Browse latest Browse all 12

Trending Articles