Given a string, return a new string made of 3 copies of the last 2 chars of the original string. The string's length will be at least 2.
...CodeWorkout X121 - X160
Score: 0 / 8.0
Exercises
Given a string, return the string made of its first two chars, so the string "Hello" yields "He". If the string is shorter than length 2,...
Return true
if the string "cat" and "dog" appear the same number of times in the given string.
Return true if the given string contains a "bob" string, but where the middle 'o' character can be any character.
Given two strings, word
and a separator sep
, return a big string made of count
occurrences of the word
, separated by the separator...
Given a string, count the number of words ending in 'y' or 'z'--so the 'y' in "heavy" and the 'z' in "fez" count, but not the 'y' in...
We have bunnies standing in a line, numbered 1, 2, ... The odd bunnies (1, 3, 5, ...) have the normal 2 ears. The even bunnies (2, 4,...
Given a non-negative int n
, compute recursively (no loops) the count of the occurrences of 8 as a digit, except that an 8 with another 8...