Lambert's problem is a classic problem of celestial mechanics. In practical cosmonautics, this problem has acquired a new meaning and is often the basis for designing spacecraft flights. In this case, it is assumed that the orbit that connects two given positions is a flight trajectory, the costs of which are determined by the sum of two velocity impulses. Thus, by solving Lambert's problem, the optimization of impulse interorbital flights is carried out, hyperbolic excesses of the speed and start of the start of interplanetary missions are determined and much more. There are a large number of methods for solving the Lambert problem, the typical time to solve the Lambert problem is quite short. However, in optimization problems built on its basis, most often it is necessary to select all the initial data that is important for the solution: initial and final position, flight time. This usually happens by adding a numerical optimization method, for example, a gradient type, to the Lambert problem. This already significantly increases the computational complexity. Therefore, it is advisable to consider a formulation similar to Lambert's problem, but providing for the optimization of flight parameters based on the minimum of the total velocity impulse. The article presents the algorithm for solving the problem of optimal two-impulse transfer between orbits in optimal time, constructed similarly to algorithms for solving the Lambert problem. The proposed method is based on the minimization problem and makes it possible to include time optimization in the solution algorithm. Copyright © 2023 by the International Astronautical Federation (IAF). All rights reserved.