Extensions of 'sun' (2) X47900


Statement
 

pdf   zip

Write a function @is_sun_extension(s)@ that given an string ss, returns True if it is possible to form the word sun by erasing zero or more letters in ss and False otherwise. Do not use the index() string method to solve this problem.

Sample session

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