Happy Numbers

Function Kata “Happy Numbers” Write a function to determine whether a given number is “happy” or not. A “happy number” is a number where the sum of the squares of its digits “in the long run” is equal to 1. Example: 19 -> 1^2 + 9^2 = 82 -> 8^2 + 2^2 = 68 ->...

To Roman Numerals

Function Kata „To Roman Numerals“ Implement a function that translates a decimal number to roman numerals. Examples: 1 -> „I“ 2 -> „II“ 4 -> „IV“ 5 -> „V“ 9 -> „IX“ 10 -> „X“ 42 -> „XLII“ 99 -> „XCIX“ 2013 -> „MMXIII“ The decimal numbers are...

ToDictionary

Function Kata „ToDictionary“ Implement a function that maps a special formatted string into a dictionary. The function should have the following signature: IDictionary<string, string> ToDictionary(string input); The following table shows some examples for input...

Christmas tree

Function Kata „Christmas tree“ Write a function that „draws“ a Christmas tree with ASCII characters (ASCII art). The „picture“should be returned as a collection of strings. See the following example of a tree with height 5: Christmastree.Draw(5) X XXX XXXXX XXXXXXX...

FizzBuzz

Function Kata „FizzBuzz“ Write a function to return the numbers from 1 to 100. However, some of the numbers should be translated into a string according to these rules [1]: return „Fizz“ for multiples of 3 return „Buzz“ for multiples of 5 return „FizzBuzz“ for...

Count Characters

Function Kata “Count Characters” Write a function to count the number of occurrences of characters in a string. The input to the function is a string, its output a Dictionary (map) of char/int pairs. IDictionary<char, int> CountCharacters(string input)...