Problem 51675. Add 100
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 CommentsShow comments
Problem Recent Solvers11