Tanium interview question

leetcode medium on ds and a