I am really stuck with this, Test cases give SIGSEGV, My code is available at here
Generating the array given on some pattern (If index even then this else that)
With Q queries given, I need to find out if given integer value can be obtained by adding some of the elements of array or not. return true if yes else no.
I tried the subset-sum approach, but I can’t figure out the issue with my code. Please help and correct me if I am wrong with the approach.
I will be happy to discuss and learn. Consider me a noob, I am just starting with competitive programming.