Cody

# Problem 568. Number of 1s in a binary string

Solution 1832777

Submitted on 31 May 2019 by rolf harkes
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
x = '0000'; y_correct = 0; assert(isequal(one(x),y_correct));

2   Pass
x = '111'; y_correct = 3; assert(isequal(one(x),y_correct));

3   Pass
x = '1100101'; y_correct = 4; assert(isequal(one(x),y_correct));
{"ft_lang_label":"__label__en","ft_lang_prob":0.65183914,"math_prob":0.9870745,"size":552,"snap":"2019-51-2020-05","text_gpt3_token_len":159,"char_repetition_ratio":0.14781022,"word_repetition_ratio":0.0,"special_character_ratio":0.34057972,"punctuation_ratio":0.14814815,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9901186,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-01-24T16:50:32Z\",\"WARC-Record-ID\":\"<urn:uuid:463d5fde-a1e2-44db-9df0-cfd93f6d9847>\",\"Content-Length\":\"72214\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:e6294490-f64b-451e-a5b9-142484689d69>\",\"WARC-Concurrent-To\":\"<urn:uuid:66262453-a63f-4cb9-8eb0-40e0f03c032d>\",\"WARC-IP-Address\":\"104.110.193.39\",\"WARC-Target-URI\":\"https://jp.mathworks.com/matlabcentral/cody/problems/568-number-of-1s-in-a-binary-string/solutions/1832777\",\"WARC-Payload-Digest\":\"sha1:WGVTJUPW6RBMVT4VBADCF3BI3VM2Y5WD\",\"WARC-Block-Digest\":\"sha1:PWHNTKTLC6EQLAFPCAAJA6PGSJQSGP6Z\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-05/CC-MAIN-2020-05_segments_1579250624328.55_warc_CC-MAIN-20200124161014-20200124190014-00395.warc.gz\"}"}