Please read the new rule regarding the restriction on the use of AI tools. ×

umang03's blog

By umang03, history, 2 years ago, In English

Someone please share the solution of the following question.

Given a binary array of size 10 which represents the state of the calculator. 1 means that digit is working. 0 means that digit is broken. Example -[0,1,1,0,0,1,0,0,0,0] indicates only digits 1, 2, 5 are working. Among the arithematic operators only multiply and equal buttons are working. You are given a number n which you have to form from this calculator. Find the minimum number of button presses you require to make the number n. Example

Calculator — [0,1,1,0,0,1,0,0,0,0] Number to form — 60 (n)

Make digit 12 (2 presses) Press x (1 press) Make digit 5 (1 press) Press = (1 press) 12 x 5 = 60 Total presses — 5 (which is the minimum number of presses required)

Full text and comments »

  • Vote: I like it
  • -11
  • Vote: I do not like it