Question asked in Amazon Germany SDE

given two sticks of length l1 and l2 and the maximum number of times each stick can be used. print all possible lengths of sticks formed
Eg stick of length 2 and 3
stick 2 can be used max of 2 times and stick 3 max of 1 time.
possible lengths of new sticks are 2,3 5,4,7

anyone ideas how to solve

Comments (2)