TomTom interview question

basic array matching algorithm implementation