Ruby Solution for Tautology program