Cody

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

Solution 485012

Submitted on 9 Aug 2014 by Pritesh Shah
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.63854134,"math_prob":0.99939513,"size":712,"snap":"2020-24-2020-29","text_gpt3_token_len":296,"char_repetition_ratio":0.17090395,"word_repetition_ratio":0.050724637,"special_character_ratio":0.48174158,"punctuation_ratio":0.1849711,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9823362,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-07-13T13:18:57Z\",\"WARC-Record-ID\":\"<urn:uuid:96589193-83bb-4b28-8ea1-a370389e78e2>\",\"Content-Length\":\"75196\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:39036d34-398a-401d-aa53-75ebc16ccb2b>\",\"WARC-Concurrent-To\":\"<urn:uuid:b4f3a963-8e53-4435-ab08-a78f637bbf5b>\",\"WARC-IP-Address\":\"104.110.193.39\",\"WARC-Target-URI\":\"https://uk.mathworks.com/matlabcentral/cody/problems/16-return-the-largest-number-that-is-adjacent-to-a-zero/solutions/485012\",\"WARC-Payload-Digest\":\"sha1:WQ36NBA6LOS6KYIXLT4JFKXN6LGKTFTF\",\"WARC-Block-Digest\":\"sha1:FDVNHVDFQHU6E2SY3X2AOZ57NOZCTMAW\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-29/CC-MAIN-2020-29_segments_1593657145436.64_warc_CC-MAIN-20200713131310-20200713161310-00416.warc.gz\"}"}