7 kyu

Monkey's MATH 01: How many "ZERO"s?

471 of 1,175myjinxin2015

Description:

Gigi is a clever monkey, living in the zoo, his teacher (animal keeper) recently taught him some knowledge of "0".

In Gigi's eyes, "0" is a character contains some circle (maybe one, maybe two).

So, a is a "0",b is a "0",6 is also a "0",and 8 have two "0" ,etc...

Now, write some code to count how many "0"s in the text.

Let us see who is smarter? You ? or monkey?

Input always be a string (including words numbers and symbols),You don't need to verify it, but pay attention to the difference between uppercase and lowercase letters.

Here is a table of characters:

Number of zeros Characters
1 abdegopq069DOPQR     () <-- A pair of braces as a zero
2 %&B8

Output will be a number of "0".

Strings
Regular Expressions
Puzzles

Stats:

CreatedFeb 16, 2016
PublishedFeb 16, 2016
Warriors Trained2009
Total Skips63
Total Code Submissions7113
Total Times Completed1175
JavaScript Completions403
Ruby Completions56
Python Completions471
C# Completions111
C++ Completions195
Total Stars20
% of votes with a positive feedback rating88% of 301
Total "Very Satisfied" Votes245
Total "Somewhat Satisfied" Votes40
Total "Not Satisfied" Votes16
Ad
Contributors
  • myjinxin2015 Avatar
  • joh_pot Avatar
  • GiacomoSorbi Avatar
  • Dentzil Avatar
  • monadius Avatar
  • hobovsky Avatar
  • Just4FunCoder Avatar
  • farhanaditya Avatar
  • saudiGuy Avatar
Ad