Added code for reversing second array for finding correct prefix values