Day 12 (10.MAY.19)

Problem Set

1. Solve the following problems using Recursion and Iteration

    • Power of a number
    • Factorial
    • GCD
    • Towers of Hanoi
    • Generating the nth Fibonacci number

2. Define a function to merge the characters of two strings alternatively. The remaining characters

of the longer string are printed in the same order at the end.

      • mergeString('abcd', 'abcd') -> 'aabbccdd'
      • mergeString('abc', '123456') -> 'a1b2c3456'
      • mergeString('0', '123456') -> '0123456'

3. Define a function to check if a given year is a leap year. Returns a boolean value

      • 2000 -> True
      • 1900 -> False
      • 2012 -> True
      • 2020 -> True
      • 0200 -> False

I've worked out all the above questions .You can access them here.