With this problem, I have added 100 to Cody. In a way, this problem asks you to add 100 as well.
Write a function to add C, the Roman numeral for 100, to one word in a list to make another word in the list. For example, you can add C to “hair” to make “chair” or to “lie” to make “lice”, assuming that all of these words are in the list. Add only one C but consider target words with multiple C’s—e.g., you can add a C to “scare” to make “scarce”. The function should return a cell array y1 with a list of original words sorted alphabetically and a corresponding cell array y2 with a list of words with the letter added.
(And if you are going to go through the trouble of writing the code for C, you might as well make it work for any letter used in English.)
Although 100 is an arbitrary milestone, it’s as good a time as any to express gratitude to MathWorks and the Cody community. Thanks to all of you for solving my problems, challenging us with your own problems, and helping me improve my own programming and problem solving.
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers13
Suggested Problems
-
500 Solvers
-
Determine if input is a Narcissistic number
215 Solvers
-
423 Solvers
-
137 Solvers
-
34 Solvers
More from this Author321
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Chris -- Interesting problem. But test #6 somehow got truncated and doesn't work.
Thanks William. My reference code worked last night. I think Cody truncated Test 6 and the seven after it because the cell array WORDS was too long. I removed several tests and asked Cody to rescore.
The test suite can be made (a bit) more interesting by adding words list in non-sorted order