Input will be an array of cities and states. Also, lists of cities and states will be passed.
Replace every city name with "city" and every state with a "state" string.
Input:
A = ["Natick", "Wayland", "Framingham", "Chicago"];
B = ["MA", "IL"];
arr = ["Wayland", "Chicago", "IL"];
Ouput:
arr = ["city", "city", "state"];
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers10
Suggested Problems
-
Swap the first and last columns
22515 Solvers
-
Return the 3n+1 sequence for n
8486 Solvers
-
10637 Solvers
-
Find Out sum of principal diagonal element of given matrix
256 Solvers
-
411 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
The problem set is incorrect. To make string variables requires usage of " " (double quotes) not ' ' single quotes. B=[ "MA" "IL"]