Occasionally someone might write text such as
Briefly explain one (1) common problem that can result from the constant use of input devices and three (3) ways that may be employed to mitigate the probable impact.
That is, they will both write numbers in words and list the numbers in parentheses.
Write a function to eliminate redundant numbers—i.e., those in parentheses that repeat numbers written in words. To represent numbers in words, follow the rules in Cody Problem 44293 (or see the test cases). Make sure to preserve other numbers. For example, given this text:
I want you to do the following: (1) buy one (1) loaf of bread, two (2) gallons of milk, and three dozen (36) eggs, (2) watch Rocky IV (4), (3) read The Autobiography of Malcolm X, and (4) start a 501(c)(3).
your function should remove only the second “(1)” and first “(2)”.
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers4
Suggested Problems
-
2164 Solvers
-
We love vectorized solutions. Problem 1 : remove the row average.
887 Solvers
-
Pattern Recognition 2 - Known Unit Length, Various Array Length (including cell arrays)
56 Solvers
-
Return fibonacci sequence do not use loop and condition version 2
64 Solvers
-
Count the square-full divisors of a number
7 Solvers
More from this Author323
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
I really enjoyed the clever examples!
Thanks. I had fun making them.