Remove all the words that end with "ain" - MATLAB Cody - MATLAB Central

Problem 31. Remove all the words that end with "ain"

Difficulty:Rate

Given the string s1, return the string s2 with the target characters removed.

For example, given

 s1 = 'the main event'

your code would return

 s2 = 'the  event'

Note the 2 spaces between "main" and "event" Only the four letters in the word "main" were deleted.

Solution Stats

29.05% Correct | 70.95% 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 Solvers2468

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