The letters a, b, d, e, g, o, p, and q all have something in common: a hole. If you imagine that the letters were made of stretchy material such as rubber, you could transform one letter into another while preserving the hole. If tearing or gluing are not allowed, no other letter (without a hole) could be transformed by stretching into one of these letters with holes. Mathemeticans say that these letters are topologically similar: one set has a hole, the rest do not.
(a) Write a function that takes as an argument a lowercase string and finds the counts of letters in the string with holes and the count of letters without holes.
(b) Write a function that searches a word list and prints all the words that have two or more letters with holes.
(c) The set of uppercase letters with holes is different than the set of lowercase letters, e.g., lowercase E belongs to the set of letters with a hole, but its capital E does not. Refactor your functions to consider uppercase letters.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.