This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Examples: | |
| # `flippedy("cat and mice") | |
| # > "cat dna mice" | |
| # | |
| def flippedy(input) | |
| words = input.split(" ") | |
| vowels_count = words.first.scan(/[aeiou]/).count |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Examples: | |
| # nearestPerfectMonths(2025) | |
| # > { prev: "2021-02", next: "2026-02" } | |
| require 'date' | |
| def find_nearest_perfect_months(year) | |
| prev_year = year - 1 | |
| prev_year -= 1 until perfect_february?(prev_year) |
OlderNewer