min steps to reach end