FB Phone screen question - solutions please?
Anonymous User
255

Given a list of numbers like Nums=[1,1,2,3,5,7,1,4,6] and a value like K = 3
return a string of numbers that result to K with combination of numbers using addition/substraction.
Ex:
Nums=[1,1,2,3,5,7,1,4,6]
K = 3
output:
1+1+1
1+2
3
5-2
7-4
6-3
6-1-1-1
6-1-2
so on..

Comments (4)