Extensions of 'sun' (2) X47900


Statement
 

pdf   zip

html

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

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