{"id":135938,"date":"2022-09-12T18:01:46","date_gmt":"2022-09-12T18:01:46","guid":{"rendered":"https:\/\/www.sushilkumar.ind.in\/blog\/?p=135938"},"modified":"2022-09-12T18:03:20","modified_gmt":"2022-09-12T18:03:20","slug":"you-are-given-a-two-digit-integer-n-return-the-sum-of-its-digits","status":"publish","type":"post","link":"https:\/\/www.sushilkumar.ind.in\/blog\/javascript\/you-are-given-a-two-digit-integer-n-return-the-sum-of-its-digits\/","title":{"rendered":"You are given a two-digit integer n. Return the sum of its digits."},"content":{"rendered":"\n<p>You are given a two-digit integer n. Return the sum of its digits.<\/p>\n\n\n\n<p>Example<\/p>\n\n\n\n<p>For n = 29, the output should be<\/p>\n\n\n\n<p>solution(n) = 11.<\/p>\n\n\n\n<p>Input\/Output<\/p>\n\n\n\n[execution time limit] 4 seconds (js)<\/p>\n\n\n\n[input] integer n<\/p>\n\n\n\n<p>A positive two-digit integer.<\/p>\n\n\n\n<p>Guaranteed constraints:<\/p>\n\n\n\n<p>10 \u2264 n \u2264 99.<\/p>\n\n\n\n[output] integer<\/p>\n\n\n\n<p>The sum of the first and second digits of the input number.<\/p>\n\n\n\n[JavaScript] Syntax Tips<\/p>\n\n\n\n<p>\/\/ Prints help message to the console<\/p>\n\n\n\n<p>\/\/ Returns a string<\/p>\n\n\n\n<p>function helloWorld(name) {<\/p>\n\n\n\n<p>&nbsp; &nbsp; console.log(&#8220;This prints to the console when you Run Tests&#8221;);<\/p>\n\n\n\n<p>&nbsp; &nbsp; return &#8220;Hello, &#8221; + name;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Solution<\/h3>\n","protected":false},"excerpt":{"rendered":"<p>You are given a two-digit integer n. Return the sum of its digits. Example For n = 29, the output should be solution(n) = 11. Input\/Output [execution time limit] 4 seconds (js) [input] integer n A positive two-digit integer. Guaranteed constraints: 10 \u2264 n \u2264 99. [output] integer The sum of the first and second &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[323],"tags":[],"class_list":["post-135938","post","type-post","status-publish","format-standard","","category-javascript"],"jetpack_publicize_connections":[],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p99pkJ-zmy","_links":{"self":[{"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/posts\/135938"}],"collection":[{"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/comments?post=135938"}],"version-history":[{"count":0,"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/posts\/135938\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/media?parent=135938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/categories?post=135938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sushilkumar.ind.in\/blog\/wp-json\/wp\/v2\/tags?post=135938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}