W.C 3.2 Wire Pieces

A wire of length n has to be cut in a way that it fulfils the following two criteria -

a. After cutting each wire piece should have length x, y or z

b. After cutting, the number of wire pieces should be maximum.

Note : if the wire cannot fulfil criteria a return -1

Find the number of wire pieces after the required cutting.

Test cases :

Case 1:
Expected result = 5 (10=2+2+2+2+2).

Case 2:

Case 3:

Case 4:

Case 5:

Case 6:

Final answer should be : sum of all 6 test cases.

This challenge is worth 80 points.

You must be logged in to submit a solution

View ranklist for this challenge
About scoring and submission

Contact Us

Kunal Desai : 7715051136

Neelraj Patil : 9930671144

Privacy Policy