Cody

# Problem 838. Check if number exists in vector

Solution 1871978

Submitted on 12 Jul 2019 by Isaac Brambley
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))

z = 1×2 logical array 1 0 y = 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))

z = 1×9 logical array 0 0 0 0 0 0 0 0 0 y = 0

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

z = 1×2 logical array 0 0 y = 0
{"ft_lang_label":"__label__en","ft_lang_prob":0.59582436,"math_prob":0.99899596,"size":721,"snap":"2019-35-2019-39","text_gpt3_token_len":266,"char_repetition_ratio":0.13528591,"word_repetition_ratio":0.14393939,"special_character_ratio":0.39805827,"punctuation_ratio":0.16571428,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99371946,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-09-21T19:30:05Z\",\"WARC-Record-ID\":\"<urn:uuid:8e5cb22f-3fae-4aea-ae64-4d313c437b55>\",\"Content-Length\":\"71000\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:4470d1e4-5e99-4373-b336-4d5c1d4c0269>\",\"WARC-Concurrent-To\":\"<urn:uuid:cd3789bc-a739-4cfb-9bd0-6e7498d5fb35>\",\"WARC-IP-Address\":\"104.110.193.39\",\"WARC-Target-URI\":\"https://www.mathworks.com/matlabcentral/cody/problems/838-check-if-number-exists-in-vector/solutions/1871978\",\"WARC-Payload-Digest\":\"sha1:GONCZB2RPCLCYEGYXOLWYNGLAQJIJCXF\",\"WARC-Block-Digest\":\"sha1:WPFWA255PBT6ODDNTJ4TPLMFYXTAFYBQ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-39/CC-MAIN-2019-39_segments_1568514574662.80_warc_CC-MAIN-20190921190812-20190921212812-00341.warc.gz\"}"}