TikTok interview question

Linux Troubleshooting. Matching substrings in a string