1
00:00:00,110 --> 00:00:01,070
Welcome back.

2
00:00:01,070 --> 00:00:07,100
Let's now get started with another interesting coding interview question which has the name word break.

3
00:00:07,100 --> 00:00:14,780
The question reads given a string s and a dictionary of strings, word dict return true.

4
00:00:14,780 --> 00:00:23,240
If s can be segmented into a space separated sequence of one or more dictionary words.

5
00:00:23,360 --> 00:00:31,370
Note that the same word in the dictionary may be reused multiple times in the segmentation, and we

6
00:00:31,370 --> 00:00:33,350
are given an example over here.

7
00:00:33,350 --> 00:00:39,200
So let's say the word which is given to us is water bottle charger water okay.

8
00:00:39,200 --> 00:00:41,240
So this is the string given to us.

9
00:00:41,240 --> 00:00:46,370
And verdict has these words water bottle and charger.

10
00:00:46,370 --> 00:00:52,610
Now if this is the input then the expected output is true because you have water.

11
00:00:52,610 --> 00:00:54,200
So you have water okay.

12
00:00:54,200 --> 00:00:55,460
Then you have bottle.

13
00:00:55,460 --> 00:01:00,170
And bottle is there in verdict and you have charger and charger is there over here.

14
00:01:00,170 --> 00:01:02,330
And water is being repeated.

15
00:01:02,330 --> 00:01:05,330
And again that's allowed because that's what's mentioned over here.

16
00:01:05,330 --> 00:01:06,710
So this is the question.

17
00:01:06,710 --> 00:01:10,310
And with the example it's pretty straightforward to understand the question.

18
00:01:10,310 --> 00:01:16,310
Now remember it's very important that you ask any clarifying questions after you're presented with a

19
00:01:16,310 --> 00:01:17,570
coding interview question.

20
00:01:17,570 --> 00:01:24,650
Now a possible question that you may want to ask for this question is, do I need to treat small case

21
00:01:24,650 --> 00:01:26,630
and uppercase letters differently?

22
00:01:26,630 --> 00:01:34,100
And let's say the interviewer replies that the string which is given to you will contain only lowercase

23
00:01:34,100 --> 00:01:34,820
letters.

24
00:01:34,820 --> 00:01:39,980
So if understood, the question which is pretty straightforward to understand when you take a look at

25
00:01:39,980 --> 00:01:46,280
the example given, and we have asked clarifying questions in the next video, let's take a quick look

26
00:01:46,280 --> 00:01:52,250
at the approaches that we are going to discuss for solving this question before we dive deeper into

27
00:01:52,250 --> 00:01:52,940
the details.
