Extensions of 'sun' X70546


Statement
 

pdf   zip

html

You have to program the function below.

  • Write a function is_sun_extension(s) that given an string s formed by lowercase letters, returns a boolean value pointing out whether we can cross out zero or more letters in s in such a way that the non ruled out letters are, from left to right, exactly ’s’, ’u’ and ’n’

Scoring

The function counts 100 points.

Sample session
>>> is_sun_extension('sun')
True
>>> is_sun_extension('assumption')
True
>>> is_sun_extension('assume')
False
>>> is_sun_extension('russian')
False
>>> is_sun_extension('scouting')
True
>>> is_sun_extension('innocuous')
False
Information
Author
ProAl
Language
English
Official solutions
Python
User solutions
Python