100-days-of-rust/Week-09/Day-59_Perfectly-Balanced
2024-09-22 12:38:48 +02:00
..
day59 Wrote program for Day 59 2024-09-22 12:38:48 +02:00
README.md Add files via upload 2023-03-23 21:38:35 -04:00

Perfectly balanced

Given a string containing only lowercase letters, find whether every letter that appears in the string appears the same number of times. Don't forget to handle the empty string ("") correctly!

Examples

balanced_bonus("xxxyyyzzz") => true
balanced_bonus("abccbaabccba") => true
balanced_bonus("xxxyyyzzzz") => false
balanced_bonus("abcdefghijklmnopqrstuvwxyz") => true
balanced_bonus("pqq") => false
balanced_bonus("fdedfdeffeddefeeeefddf") => false
balanced_bonus("www") => true
balanced_bonus("x") => true
balanced_bonus("") => true