Finding Palindromes in Ruby
In this guide You will learn how to return palindromes of a given size.
Guide Tasks
  • Read Tutorial
  • Complete the Exercise

Summary

Build out a method that will return all palindromes of a given size.

Exercise Description

"Build out a method that will return all palindromes of a given size and return an empty array if the given size of the palindrome is not found."

Example Data

'str = 'I am going to jump into my racecar and see tacocat'
str_with_different_cases = 'Time to jump into my racEcAr and see Tacocat' '
->expect(all_palindromes(7, str)).to eq(['racecar', 'tacocat'])
    expect(all_palindromes(7, str_with_different_cases)).to eq(['racEcAr', 'Tacocat'])
    expect(all_palindromes(1, str)).to eq(['I'])

Real World Usage

This exercise will help you in real world applications because its important to be able to return all desired data from a search, even in the data as a whole has some uniq attributes.

Test Cases

Code File