Solution<\/strong><\/p>\nimport java.io.IOException;\n\npublic class RepeatedString {\n static long repeatedString(String s, long n) {\n long noOfOccurence = 0;\n for (int i = 0; i < s.length(); i++) {\n if (s.charAt(i) == 'a')\n noOfOccurence++;\n }\n long repeat = n \/ s.length();\n noOfOccurence *= repeat;\n for (int i = 0; i < n % s.length(); i++) {\n if (s.charAt(i) == 'a')\n noOfOccurence++;\n }\n return noOfOccurence;\n }\n\n public static void main(String[] args) throws IOException {\n String s = \"aba\";\n long n = 10;\n long result = repeatedString(s, n);\n System.out.println(result);\n }\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"Problem Solution<\/p>\n","protected":false},"author":1,"featured_media":694,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42],"tags":[43],"_links":{"self":[{"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/posts\/729"}],"collection":[{"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/comments?post=729"}],"version-history":[{"count":0,"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/posts\/729\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/media\/694"}],"wp:attachment":[{"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/media?parent=729"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/categories?post=729"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.learnerandtutor.com\/wp-json\/wp\/v2\/tags?post=729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}