Cody

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

Solution 1723815

Submitted on 9 Feb 2019 by Natasa
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.60465837,"math_prob":0.98681325,"size":606,"snap":"2020-24-2020-29","text_gpt3_token_len":174,"char_repetition_ratio":0.14285715,"word_repetition_ratio":0.0,"special_character_ratio":0.330033,"punctuation_ratio":0.13445379,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9908141,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-05-28T22:13:24Z\",\"WARC-Record-ID\":\"<urn:uuid:348464c6-eb12-450c-8798-3b579a68136c>\",\"Content-Length\":\"72266\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:9ebb84b1-71ef-429b-b8c7-4505800ac8bb>\",\"WARC-Concurrent-To\":\"<urn:uuid:014e3ef0-6e79-45ca-8590-72d15dcf45db>\",\"WARC-IP-Address\":\"23.13.150.165\",\"WARC-Target-URI\":\"https://fr.mathworks.com/matlabcentral/cody/problems/568-number-of-1s-in-a-binary-string/solutions/1723815\",\"WARC-Payload-Digest\":\"sha1:WRX477SCM4MD4IM63YF7YAPUSUIK7YUL\",\"WARC-Block-Digest\":\"sha1:4IJMY26VOLYDKDQ43MVEPBUCPJTBABKM\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-24/CC-MAIN-2020-24_segments_1590347400101.39_warc_CC-MAIN-20200528201823-20200528231823-00589.warc.gz\"}"}