1
00:00:00,320 --> 00:00:01,040
Hey there.

2
00:00:01,040 --> 00:00:02,090
Welcome back.

3
00:00:02,660 --> 00:00:08,240
Let's now take a look at a very famous coding interview question called combinations.

4
00:00:08,810 --> 00:00:19,160
So the question reads given two integers n and k, return all possible combinations of k numbers chosen

5
00:00:19,160 --> 00:00:21,290
from the range one comma n.

6
00:00:21,290 --> 00:00:25,640
So let's say n is equal to four and k is equal to two.

7
00:00:25,670 --> 00:00:33,890
So in the example that's given to us, we have to form all possible combinations of two numbers from

8
00:00:33,890 --> 00:00:37,640
the range one comma n which is 1234.

9
00:00:37,640 --> 00:00:43,790
So notice over here we have one comma two one comma three one comma four, two comma three, two comma

10
00:00:43,790 --> 00:00:45,680
four and three comma four.

11
00:00:45,680 --> 00:00:52,160
So these are all the possible combinations that can be made which consist of two numbers from the range

12
00:00:52,160 --> 00:00:53,450
one comma four.

13
00:00:53,450 --> 00:01:00,440
And then the question also says that you may return the answer in any order, which means that one comma

14
00:01:00,440 --> 00:01:04,550
two will be treated as the same as two comma one.

15
00:01:05,030 --> 00:01:06,860
So we have understood the question.

16
00:01:06,860 --> 00:01:14,510
And again, remember in a coding interview, it's important that you ask the interviewer any clarifying

17
00:01:14,510 --> 00:01:16,670
questions which you may want to ask.

18
00:01:17,180 --> 00:01:24,710
So for this question a possible clarifying question could be will k be less than n at any point?

19
00:01:24,710 --> 00:01:27,080
Because in that case that would be a problem.

20
00:01:27,080 --> 00:01:30,260
What if n is equal to four but k is equal to ten?

21
00:01:30,260 --> 00:01:38,600
Let's say to this question, the interviewer replies no, k will always be between one and n, both

22
00:01:38,600 --> 00:01:39,680
inclusive.

23
00:01:39,710 --> 00:01:40,370
All right.

24
00:01:40,370 --> 00:01:45,380
So we have understood the question, and we have asked any clarifying questions that we may want to

25
00:01:45,380 --> 00:01:45,950
ask.

26
00:01:45,950 --> 00:01:51,380
Now in the next video, let's think through the approach that we can take to solve this question.
