Inputs on this Question

Hi,

I came across this question and wasn't able to solve it. Can someone help me in getting the solution.

You are given an infinite number of dice and you want to represent numbers with them. A represented number is lining up dice faces to make up the number, so 11 is 2 dies of faces 1 and 1, 15 is one '1' facing die and one '5' facing die . A number can only be represented fully or be a sum of fully represented numbers.for example:

  • 66 can be represented fully
  • 82 cannot as we don't have a die face for '8' so we have to find a number that sums to 82 and is made up of representable number, so 82 can be 66 + 16 and that would be the correct representation

Given any number, you need to find the optimal way to represent it with the smalles number of representable numbers.

Any idea on how to solve this ?

Comments (1)