0

I have an exercise that is killing my brain; which is: I have x sticks, and I break them into x chunks which I measure, they are a vector of numbers, the solution to the problem is to find the minimum number to create sticks of the same size:

Sample input

9

5 2 1 5 2 1 5 2 1

4

1 2 3 4

0 (this is the end of the input it have to be there)

Sample output

6

5
  • 1
    Welcome to StackOverflow. In order to get a good answer to your question, it's important to be specific about the problem you're running into. Your question currently doesn't actually ask a question: it just says you have an exercise that you're struggling with. Please read [this](https://stackoverflow.com/help/how-to-ask) for tips on asking a good question, and refine this question accordingly. – StriplingWarrior Dec 07 '20 at 17:07
  • "...the solution to the problem is to find the minimum number to create sticks of the same size" - have you tried to make algorithm for this ? once your logic is ready, you can go for implementation. Then finally post your code sample to https://codereview.stackexchange.com for further assistance – Haripriya Dec 07 '20 at 17:48

0 Answers0