Cody

# Problem 16. Return the largest number that is adjacent to a zero

Solution 1817599

Submitted on 16 May 2019 by Qinghua Ye
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, 5, 3, 0, 2, 7, 0, 8, 9, 1 0]; b = 8; assert(isequal(nearZero(a),b))

2   Pass
a = [5 4 -1 0 -2 0 -5 8]; b = -1; assert(isequal(nearZero(a),b));

3   Pass
a = [0 3 1 0 2 9]; b = 3; assert(isequal(nearZero(a),b));

4   Pass
a = [1 0 2 0 3]; b = 3; assert(isequal(nearZero(a),b));

5   Pass
a = [0 -1]; b = -1; assert(isequal(nearZero(a),b));

6   Pass
a = [0 -12 0 -7 0]; b = -7; assert(isequal(nearZero(a),b));
{"ft_lang_label":"__label__en","ft_lang_prob":0.6074177,"math_prob":0.9993055,"size":794,"snap":"2020-10-2020-16","text_gpt3_token_len":338,"char_repetition_ratio":0.17341772,"word_repetition_ratio":0.027777778,"special_character_ratio":0.4836272,"punctuation_ratio":0.18719211,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98102695,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-02-18T18:58:38Z\",\"WARC-Record-ID\":\"<urn:uuid:d4554135-7e07-4c2f-b71f-3634f6a2fb74>\",\"Content-Length\":\"76446\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:17109a49-a40b-471b-a9f2-3e95a21fa2d2>\",\"WARC-Concurrent-To\":\"<urn:uuid:723148a6-b19e-40f7-b60b-0d9eb995b204>\",\"WARC-IP-Address\":\"23.218.145.211\",\"WARC-Target-URI\":\"https://nl.mathworks.com/matlabcentral/cody/solutions/1817599\",\"WARC-Payload-Digest\":\"sha1:6KVKJ6BNWWDZVAVCINNQ4SBQV5XSHHE4\",\"WARC-Block-Digest\":\"sha1:FQIREEJPGL3IS5N2PCFQZPHDEINAMJKZ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-10/CC-MAIN-2020-10_segments_1581875143805.13_warc_CC-MAIN-20200218180919-20200218210919-00238.warc.gz\"}"}