Tanium interview question

String manipulation and array traversal, Leetcode easy-medium