Map the given integer to a month.
Example:
mo = 1
, the output should be getMonthName(mo) = "Jan"
,mo = 0
, the output should be getMonthName(mo) = "invalid month"
.Find the number of even digits in the given integer.
Example
n = 1010
, the output should be numberOfEvenDigits(n) = 2
.n = 123
, the output should be numberOfEvenDigits(n) = 1
.Given a string, return its encoding defined as follows:
First, the string is divided into the least possible number of disjoint substrings consisting of identical characters
for example, "aabbbc"
is divided into ["aa", "bbb", "c"]
Next, each substring with length greater than one is replaced with a concatenation of its length and the repeating character
for example, substring "bbb"
is replaced by "3b"
Finally, all the new strings are concatenated together in the same order and a new string is returned.
Author Question: Argaen
Code Fights Weekly has gained popularity in the past months and is receiving lots of fan letters. Unfortunately, some of the readers use offensive words and the editor wants to keep the magazine family friendly.