ON AN EFFECTIVE SOLUTION OF THE OPTIMAL STOPPING PROBLEM FOR RANDOM WALKS