Word Order Hackerrank Solution