interview problem

Правка en2, от Hisham_hates_graphs, 2020-06-20 00:24:32

there is an interview problem i want you to help me solve if you can please suppose we have many stones each stone have a uniqe number

we arrange this stones to make shapes

example

we make a shape with 3 stones {4,8,3} and make shape with 4 stones {5,3,6,7}

note that we can use the same type of stone more than once (so you can say that we have infinite number of each type)

i want to set this data in array of integer so we can read from the array every set of stones that make a shape

no hash maps no array of strings no array of pairs just array of integers

and dont suggest to put 8 in index 4 and put 3 in index 8 and put 4 in index 3 because number 3 here will belong to just this shape and dont belong to the other one

is there anyway?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Hisham_hates_graphs 2020-06-20 00:24:32 2 Tiny change: ' me solve it if you ca' -> ' me solve if you ca'
en1 Английский Hisham_hates_graphs 2020-06-20 00:24:09 800 Initial revision (published)