alg: shifted array search