##
Ways to represent a number as a sum of 1’s and 2’s
March 12, 2017

Given a positive integer N. The task is to find the number of ways of representing N as a sum of 1s and 2s. Examples: Input : N = 3 Output : 3 3 can be represented as (1+1+1), (2+1), (1+2). Input : N = 5 Output : 8 For N = 1, answer is… Read More »