UST interview question

based on linked list , string