finding largest integer without sorting