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)
if question link is there the pls share.I wan check my solution.
If question link is there, please share. I want to understand the statement.
Question link is not there it came in my online assessment. But the question and example is correct.
They are probably correct in the sense that you tried to write the statement as you remembered it, but as of right now, the statement is a bit unclear and incomplete. What does it mean exactly that a "digit is broken"? Does it mean the key is broken or does it mean the digit can never appear on the screen?
And most importantly, what is the constraint on $$$n$$$? (Also if time limit is nonstandard, that is important information too.)
Do a dp over all factors of the number
https://pastebin.com/zYhVrL3Y