Quantum Algorithm for the Collision Problem