Cody

# Problem 838. Check if number exists in vector

Solution 1846780

Submitted on 11 Jun 2019 by Magid Mostafa
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
a = 1; b = [1,2]; y_correct = 1; assert(isequal(existsInVector(a,b),y_correct))

ans = logical 1

2   Pass
a = 12; b = [1,3,4,5,6,7,8,1,2]; y_correct = 0; assert(isequal(existsInVector(a,b),y_correct))

ans = logical 0

3   Pass
a = -1; b = [1,2]; y_correct = 0; assert(isequal(existsInVector(a,b),y_correct))

ans = logical 0
{"ft_lang_label":"__label__en","ft_lang_prob":0.6409328,"math_prob":0.99769366,"size":617,"snap":"2020-34-2020-40","text_gpt3_token_len":211,"char_repetition_ratio":0.13213703,"word_repetition_ratio":0.12371134,"special_character_ratio":0.36628848,"punctuation_ratio":0.20714286,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9912517,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-08-05T05:25:34Z\",\"WARC-Record-ID\":\"<urn:uuid:67495319-67be-4ff5-a94d-63f8ba8a1b7b>\",\"Content-Length\":\"71922\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:ee9108e0-3e7f-4064-8893-d2ff6cc3b042>\",\"WARC-Concurrent-To\":\"<urn:uuid:7e625a7b-8e51-41a2-8b4a-6e5b423614a1>\",\"WARC-IP-Address\":\"23.66.56.59\",\"WARC-Target-URI\":\"https://fr.mathworks.com/matlabcentral/cody/problems/838-check-if-number-exists-in-vector/solutions/1846780\",\"WARC-Payload-Digest\":\"sha1:J2MM7JHB4HFKPX7OEIP4QSJ5AJUP3BDV\",\"WARC-Block-Digest\":\"sha1:ALJRQEM4GU3XL5TNBI6WULBLULDLMDK3\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-34/CC-MAIN-2020-34_segments_1596439735909.19_warc_CC-MAIN-20200805035535-20200805065535-00405.warc.gz\"}"}