NiCE interview question

write a code for string valid