Tanium Interview Question

String manipulation and array traversal, Leetcode easy-medium