Find state names that start with the letter N - MATLAB Cody - MATLAB Central

Problem 92. Find state names that start with the letter N

Difficulty:Rate
Given a list of US states, remove all the states that start with the letter N, leaving surrouding spaces intact. For example:
If
s1 = 'Alabama Montana Nebraska Vermont Nevada';
then
s2 = 'Alabama Montana Vermont ';
Notice that the spaces before and after "Nebraska" in s1 still remain between "Montana" and "Vermont" in s2. The same applies for the space before "Nevada".
Be mindful of two-word states that also start with the letter N, like "New York" or "North Carolina". For example:
If
s1 = 'Alabama Montana New York Vermont';
then
s2 = 'Alabama Montana Vermont';
Notice that the spaces before and after "New York" in s1 still remain between "Montana" and "Vermont" in s2.

Solution Stats

25.28% Correct | 74.72% Incorrect
Last Solution submitted on May 09, 2025

Problem Comments

Solution Comments

Show comments
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
3

Group

Cody Challenge Image
Cody Challenge
  • 12 Problems
  • 507 Finishers

Problem Recent Solvers1338

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page