Cody

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

Solution 334403

Submitted on 16 Oct 2013 by Eli Gershon
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.52241117,"math_prob":0.99953747,"size":685,"snap":"2019-35-2019-39","text_gpt3_token_len":297,"char_repetition_ratio":0.16740088,"word_repetition_ratio":0.05185185,"special_character_ratio":0.5080292,"punctuation_ratio":0.2035928,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98089135,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-08-24T22:07:05Z\",\"WARC-Record-ID\":\"<urn:uuid:980dd51e-e374-4575-aba1-450a4f824df1>\",\"Content-Length\":\"74205\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:9efcbf1c-c5e4-40d0-852d-f6fe7c2f2b08>\",\"WARC-Concurrent-To\":\"<urn:uuid:707377f0-c60d-4369-88fb-825fa8a75d10>\",\"WARC-IP-Address\":\"104.104.91.201\",\"WARC-Target-URI\":\"https://uk.mathworks.com/matlabcentral/cody/problems/16-return-the-largest-number-that-is-adjacent-to-a-zero/solutions/334403\",\"WARC-Payload-Digest\":\"sha1:3UKEVKX52VXIK4IRDMEQVPXI4HJEWOON\",\"WARC-Block-Digest\":\"sha1:NLQIX2HHZL4XQZECH2YQGBBVT4QPRQUC\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-35/CC-MAIN-2019-35_segments_1566027321786.95_warc_CC-MAIN-20190824214845-20190825000845-00283.warc.gz\"}"}