NiCE Interview Question

write a code for string valid