I am really bad in math and complexity calculations so I would like to ask you for help.
I need to write a function which takes an array of integers and another integer and returns true if any combination of integers inside the array (sum) equals to the another integer and false otherwise.
The best result I was able to achieve is O(n!)
- Pretty newbie performance...
Could you please help me write such a function in a more efficient way? Or at least give me a hint.