From 7528c2bcf805347c8400c7369323412b761eefc7 Mon Sep 17 00:00:00 2001 From: Rakshit Gupta Date: Sat, 27 Oct 2018 10:08:27 +0530 Subject: [PATCH] updated dp.md with a typical question --- algorithms/dynamic-programming.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/algorithms/dynamic-programming.md b/algorithms/dynamic-programming.md index 978fa611..327d9c96 100644 --- a/algorithms/dynamic-programming.md +++ b/algorithms/dynamic-programming.md @@ -24,3 +24,10 @@ Dynamic Programming // [4, 10, 3, 1, 5] => 15 ~~~ - Given a list of denominations (e.g., `[1, 2, 5]` means you have coins worth $1, $2, and $5) and a target number `k`, find all possible combinations, if any, of coins in the given denominations that add up to `k`. You can use coins of the same denomination more than once. +- You are climbing a stair case. It takes n steps to reach to the top. +Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? +Example - +Input : 3; +Return : 3; +Steps : [1 1 1], [1 2], [2 1] +