Cody

# Problem 43. Subset Sum

Given a vector v of integers and an integer n, return the the indices of v (as a row vector in ascending order) that sum to n. If there is no subset in v that sums to n, return an empty matrix []. You can assume that the answer will always be unique.

Example:

``` >> v = [2, 3, 5];
>> n = 8;
>> subset_sum(v, n)
ans =
2     3```

### Solution Stats

30.52% Correct | 69.48% Incorrect
Last Solution submitted on Feb 10, 2020
{"ft_lang_label":"__label__en","ft_lang_prob":0.8823575,"math_prob":0.9679074,"size":2910,"snap":"2020-10-2020-16","text_gpt3_token_len":770,"char_repetition_ratio":0.11080523,"word_repetition_ratio":0.3553875,"special_character_ratio":0.27697596,"punctuation_ratio":0.121306375,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9987896,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-02-16T23:31:16Z\",\"WARC-Record-ID\":\"<urn:uuid:94df2c2c-d861-4644-a492-a07aa9f8cc79>\",\"Content-Length\":\"158674\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:8676f28f-aa84-48d4-9dc7-660cc3cb7b43>\",\"WARC-Concurrent-To\":\"<urn:uuid:0945d01f-3bb0-42e2-b7e6-08344b00c78e>\",\"WARC-IP-Address\":\"104.96.217.125\",\"WARC-Target-URI\":\"https://se.mathworks.com/matlabcentral/cody/problems/43?s_tid=prof_contriblnk\",\"WARC-Payload-Digest\":\"sha1:SWG3MLHIDGK6UHY3XCPNUPURA27U3YXQ\",\"WARC-Block-Digest\":\"sha1:5KKEVTZUJ66ZVKGSTSGATQJWSLDWNNVL\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-10/CC-MAIN-2020-10_segments_1581875141430.58_warc_CC-MAIN-20200216211424-20200217001424-00366.warc.gz\"}"}