Skip to content

Commit d5fff45

Browse files
authored
Update README.md
formatting added
1 parent 35c8487 commit d5fff45

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,29 @@
11
# Algorithms
22
This repository will contain solution for interview questions asked from the popular companies and some questions published in the internet as well.
3+
4+
## staircaseproblem.py has the below problem.
5+
There's a staircase with N steps, and you can climb 1 or 2 steps at a time. Given N, write a function that returns the number of unique ways you can climb the staircase. The order of the steps matters.
6+
7+
For example, if N is 4, then there are 5 unique ways:
8+
9+
10+
1, 1, 1, 1
11+
12+
2, 1, 1
13+
14+
1, 2, 1
15+
16+
1, 1, 2
17+
18+
2, 2
19+
20+
What if, instead of being able to climb 1 or 2 steps at a time, you could climb any number from a set of positive integers X? For example, if X = {1, 3, 5}, you could climb 1, 3, or 5 steps at a time. Generalize your function to take in X.
21+
22+
---
23+
24+
## ListHasNumberPair.py
25+
Given a list of numbers and a number k, return whether any two numbers from the list add up to k.
26+
27+
For example, given [10, 15, 3, 7] and k of 17, return true since 10 + 7 is 17.
28+
29+
---

0 commit comments

Comments
 (0)