Challenge Nov-2020

Calculator with Two Buttons                                                                                 Solutions

A calculator, initially displaying 0, has only two buttons: “+” adds 1 to the number on display; “x” multiplies number on display by 10. What is the least number of button presses needed to show 5034? (courtesy of Hakan Kjellerstrand)

Submit your solutions using your favorite tools or just common sense. How to make sure that your solution is optimal?