Citadel Securities Interview Question

Checking the order of words in an array.