1
00:00:04,530 --> 00:00:06,360
OK, so let us soil.

2
00:00:06,600 --> 00:00:07,570
Problem number two.

3
00:00:11,460 --> 00:00:17,330
So the problem, this treatment is we have to find largest of any numbers.

4
00:00:19,520 --> 00:00:21,700
Largest off any numbers.

5
00:00:24,370 --> 00:00:27,610
We have already covered a simple version of this problem.

6
00:00:28,090 --> 00:00:31,450
The problem was you have to find the largest of 10 numbers.

7
00:00:31,960 --> 00:00:34,960
So the flow chart was something like this.

8
00:00:35,170 --> 00:00:44,440
You start you read 10 numbers, A, B and C, and then you check is eager, then B and is eager.

9
00:00:44,440 --> 00:00:46,570
Then C, in that case, you will print it.

10
00:00:46,770 --> 00:00:53,530
And Andy, a program, if this is not true, you will check for B is bigger than A and is bigger than

11
00:00:53,530 --> 00:00:53,860
C.

12
00:00:54,220 --> 00:00:58,120
If this condition is true, you will print B and then you will end your program.

13
00:00:58,690 --> 00:01:03,100
Similarly, if it is not the largest number, B is not the largest number.

14
00:01:03,190 --> 00:01:05,710
So that automatically means sees the largest number.

15
00:01:05,920 --> 00:01:08,320
So you will Pennsy and then you will end up little.

16
00:01:08,860 --> 00:01:10,410
We have already covered the discussion.

17
00:01:10,720 --> 00:01:14,710
So what is the difference between this problem and this problem?

18
00:01:16,390 --> 00:01:18,310
So the defense is obvious here.

19
00:01:18,400 --> 00:01:22,010
I know that there are only two numbers here.

20
00:01:22,390 --> 00:01:24,460
I don't know how many numbers.

21
00:01:24,970 --> 00:01:30,060
So if I know that they're only two numbers, I will get three variables, a BNC.

22
00:01:30,880 --> 00:01:37,390
But in this case, I don't know how many variables do I have to make because I don't know the value

23
00:01:37,390 --> 00:01:37,540
of.

24
00:01:37,640 --> 00:01:40,480
And as the value often will be given by user.

25
00:01:40,900 --> 00:01:45,820
So the first problem is how do I read in numbers?

26
00:01:46,970 --> 00:01:47,660
What will I do?

27
00:01:47,780 --> 00:01:50,450
I will run a loop and times.

28
00:01:54,280 --> 00:01:57,490
I will run a loop and times with the help of these three blogs.

29
00:01:58,210 --> 00:01:59,110
I equals one.

30
00:02:00,630 --> 00:02:02,190
I iList and I was too in.

31
00:02:04,340 --> 00:02:05,750
I was a plus one.

32
00:02:06,650 --> 00:02:11,920
So with the help of these three blogs, I will be able to run a loop and times.

33
00:02:12,850 --> 00:02:13,180
OK.

34
00:02:13,580 --> 00:02:16,280
Each time this loop is running, I will do that number.

35
00:02:18,720 --> 00:02:19,420
Give you the number.

36
00:02:20,010 --> 00:02:22,620
So in total, I will be able to read in numbers.

37
00:02:24,810 --> 00:02:27,460
So the first part of our problem is or what?

38
00:02:28,520 --> 00:02:30,510
That is how we can read and numbers.

39
00:02:30,600 --> 00:02:33,330
So with the help of a loop, we can read in numbers.

40
00:02:34,360 --> 00:02:39,200
Now, the second part I had to find largest of all these numbers.

41
00:02:40,480 --> 00:02:42,460
So this part is a little bit tricky.

42
00:02:43,390 --> 00:02:44,290
So what will I do?

43
00:02:44,800 --> 00:02:46,660
I will use a variable largest.

44
00:02:47,920 --> 00:02:50,500
Initially, my largest will be minus infinity.

45
00:02:52,020 --> 00:02:54,750
Initially, my largest will be minus infinity.

46
00:02:55,230 --> 00:02:57,000
Then I will try to maximize it.

47
00:02:57,540 --> 00:02:58,260
What will I do?

48
00:02:58,770 --> 00:02:59,220
You're kidding.

49
00:02:59,280 --> 00:02:59,630
No.

50
00:03:00,000 --> 00:03:00,250
OK.

51
00:03:00,350 --> 00:03:02,100
Compare this number with the largest.

52
00:03:02,700 --> 00:03:07,050
If the number that you have read is greater than the largest.

53
00:03:09,130 --> 00:03:14,910
Then upgrade the value of largest, largest is equal to no otherwise.

54
00:03:16,030 --> 00:03:16,910
Do not think.

55
00:03:18,320 --> 00:03:23,840
Simple to vent, this loop will terminate my variable largest.

56
00:03:25,260 --> 00:03:30,600
We'll be storing the largest of all this in numbers and then I will bring to my largest.

57
00:03:31,530 --> 00:03:32,730
OK, so let us draw the floor.

58
00:03:32,800 --> 00:03:33,120
Jack.

59
00:03:40,170 --> 00:03:41,650
So I will start my flow chart.

60
00:03:43,210 --> 00:03:44,650
Then I will read an.

61
00:03:47,300 --> 00:03:50,530
Then I will take I will use two variable.

62
00:03:50,600 --> 00:03:56,990
Initially I was one and largest equals minus infinity.

63
00:03:59,120 --> 00:04:01,580
Then I will try to maximize largest.

64
00:04:02,420 --> 00:04:04,340
So for running the loop and time.

65
00:04:04,910 --> 00:04:05,600
What will I do?

66
00:04:06,200 --> 00:04:07,820
Is a list and it goes to doing.

67
00:04:10,530 --> 00:04:12,460
And similarly, I will be having here.

68
00:04:12,900 --> 00:04:14,050
I will say blessin.

69
00:04:16,840 --> 00:04:23,790
So with the help of these three blogs, I equals when I listen was when I was a policeman, my loop

70
00:04:23,800 --> 00:04:24,750
will end times.

71
00:04:25,150 --> 00:04:27,670
So if this condition is true, yes, I.

72
00:04:27,700 --> 00:04:29,950
Is less than articles to end.

73
00:04:30,340 --> 00:04:30,750
I really do.

74
00:04:30,760 --> 00:04:31,010
No.

75
00:04:31,930 --> 00:04:32,560
In the loop.

76
00:04:32,680 --> 00:04:33,990
I have to read a number.

77
00:04:36,750 --> 00:04:39,270
Now, you have to compare this number with the largest.

78
00:04:40,680 --> 00:04:46,500
So if then the murder to have read is greater, then largest.

79
00:04:48,950 --> 00:04:55,870
That means I have to update my now just so if this condition is true, yes, then a mother to have it

80
00:04:55,930 --> 00:04:56,290
is good.

81
00:04:56,310 --> 00:04:58,660
Then largest, then update largest.

82
00:04:59,270 --> 00:05:01,410
So largest as it goes to them.

83
00:05:02,780 --> 00:05:06,520
Now my largest number, is it close to the number there to have had.

84
00:05:07,970 --> 00:05:08,660
And then.

85
00:05:12,880 --> 00:05:14,300
You have Dorinda, The Luban Times.

86
00:05:15,380 --> 00:05:17,140
Okay, so what if this condition is false?

87
00:05:17,290 --> 00:05:18,490
If this condition is false?

88
00:05:19,800 --> 00:05:21,300
There is no need to do anything.

89
00:05:22,280 --> 00:05:22,620
No.

90
00:05:22,770 --> 00:05:28,950
And then you will simply run this loop and times and vendors loop will break.

91
00:05:29,670 --> 00:05:31,080
When this condition will be false.

92
00:05:33,030 --> 00:05:39,630
I will bring largest because logistics storing the largest of all this and numbers.

93
00:05:40,960 --> 00:05:43,390
After printing, I just I will end my program.

94
00:05:46,080 --> 00:05:47,330
OK, so let US Airways.

95
00:05:47,700 --> 00:05:48,420
What do you have done?

96
00:05:49,610 --> 00:05:55,500
We will try to understand this flowchart with the help of an example, let's say, and equals three.

97
00:05:56,010 --> 00:06:00,780
And that training must be three, two and five.

98
00:06:01,580 --> 00:06:02,460
So and it goes three.

99
00:06:02,550 --> 00:06:04,260
And the numbers are three, 25.

100
00:06:04,740 --> 00:06:06,690
So my largest is equals to five.

101
00:06:08,440 --> 00:06:08,660
OK.

102
00:06:08,720 --> 00:06:11,140
So let us run this flowchart.

103
00:06:11,730 --> 00:06:14,790
Start a read and and it in three.

104
00:06:15,180 --> 00:06:16,440
Initially I equals one.

105
00:06:16,830 --> 00:06:22,560
I equals one and largest as it goes to minus infinity.

106
00:06:23,370 --> 00:06:23,620
OK.

107
00:06:24,330 --> 00:06:25,560
So you will come here.

108
00:06:26,280 --> 00:06:27,570
Is one less done.

109
00:06:27,570 --> 00:06:28,170
It goes to three.

110
00:06:28,230 --> 00:06:29,230
So the condition is true.

111
00:06:29,310 --> 00:06:30,020
You will come here.

112
00:06:30,460 --> 00:06:30,660
OK.

113
00:06:31,020 --> 00:06:31,740
Rule number.

114
00:06:35,720 --> 00:06:36,990
Is three good?

115
00:06:37,030 --> 00:06:40,150
The largest is three, then minus infinity.

116
00:06:40,280 --> 00:06:41,990
Yes, three is obviously good.

117
00:06:42,080 --> 00:06:43,130
Then minus infinity.

118
00:06:43,670 --> 00:06:44,600
So you will come here.

119
00:06:46,030 --> 00:06:48,790
You have to update the relief of largest, so largest.

120
00:06:48,850 --> 00:06:51,530
Is it close to the number that you have ordered?

121
00:06:52,150 --> 00:06:52,960
So largest?

122
00:06:54,240 --> 00:06:55,880
Is it close to three?

123
00:06:56,730 --> 00:07:01,350
And then you will include when they really if I buy one.

124
00:07:01,380 --> 00:07:03,660
So the new value of AI is to.

125
00:07:05,310 --> 00:07:09,790
You will check the condition again, is through less than a ghost territory.

126
00:07:10,530 --> 00:07:12,540
Yes, the condition is true.

127
00:07:12,630 --> 00:07:14,050
You will come here every day.

128
00:07:14,100 --> 00:07:14,490
No.

129
00:07:17,060 --> 00:07:18,900
Is too great.

130
00:07:19,040 --> 00:07:21,050
Then largest, largest as equals two, three.

131
00:07:21,320 --> 00:07:23,460
So is to a good entry.

132
00:07:23,750 --> 00:07:24,080
No.

133
00:07:24,200 --> 00:07:24,920
You will come here.

134
00:07:28,520 --> 00:07:33,960
And given the way I live, if I buy one so there's no change in the value of largest largesse just to

135
00:07:33,980 --> 00:07:38,870
year and given I really if I buy one so the new value of AI is three.

136
00:07:39,410 --> 00:07:42,870
And then you will come here is three less.

137
00:07:42,940 --> 00:07:43,850
Then it goes to three.

138
00:07:43,880 --> 00:07:45,080
So the condition is true.

139
00:07:45,350 --> 00:07:46,070
You will come here.

140
00:07:46,140 --> 00:07:48,260
Rule number five.

141
00:07:49,620 --> 00:07:52,800
You will come here is five good, then three.

142
00:07:53,070 --> 00:07:53,460
Yes.

143
00:07:53,790 --> 00:07:55,170
Five is obviously good.

144
00:07:55,200 --> 00:07:55,700
Then three.

145
00:07:55,980 --> 00:07:59,430
So you will come here and you will appreciate the relief.

146
00:07:59,430 --> 00:07:59,970
Largest.

147
00:08:00,430 --> 00:08:01,350
So largest.

148
00:08:02,070 --> 00:08:03,180
Is it close to five?

149
00:08:04,860 --> 00:08:06,210
And then you've come here.

150
00:08:08,230 --> 00:08:11,530
Incrementally, if I wear one, so the new vilify is four.

151
00:08:12,370 --> 00:08:17,140
And then you will come here is for less than articles two three.

152
00:08:17,350 --> 00:08:17,730
No.

153
00:08:18,580 --> 00:08:19,180
False.

154
00:08:19,660 --> 00:08:20,800
So we'll print largest.

155
00:08:20,890 --> 00:08:22,120
You will print five.

156
00:08:23,140 --> 00:08:25,310
And then you will endure program.

157
00:08:25,840 --> 00:08:27,070
So I am printing five.

158
00:08:29,450 --> 00:08:31,860
So my flowchart is hundred percent correct.

159
00:08:32,610 --> 00:08:34,150
So let us revise what we have done.

160
00:08:35,580 --> 00:08:41,790
So the problem was we have to find the largest of any numbers and we have all this oil, a simple version

161
00:08:41,790 --> 00:08:42,540
of this problem.

162
00:08:42,900 --> 00:08:48,060
The simple question was, do we have to find the largest of three numbers since we know that there are

163
00:08:48,060 --> 00:08:48,930
only three numbers?

164
00:08:49,440 --> 00:08:51,270
So I use only three variables.

165
00:08:51,390 --> 00:08:53,550
But in this case, I don't really often.

166
00:08:54,210 --> 00:08:56,400
So I don't know how many variables do I have to make?

167
00:08:56,970 --> 00:08:59,880
So the first problem is how to read and numbers.

168
00:09:00,990 --> 00:09:05,580
So we will run the low end times and each time I will read a number.

169
00:09:06,180 --> 00:09:07,450
So the first problem is over.

170
00:09:08,340 --> 00:09:13,380
I will be able to read and numbers and how this loop will end and times with the help of these three

171
00:09:13,380 --> 00:09:13,790
blogs.

172
00:09:13,860 --> 00:09:16,770
I will be able to run my loop end times.

173
00:09:17,400 --> 00:09:22,350
And the second problem is I have to find largest of all this and numbers.

174
00:09:22,740 --> 00:09:23,760
So what will I do?

175
00:09:23,820 --> 00:09:29,760
I will use a variable largest, initially my variable largest as it goes to minus Infinity.

176
00:09:30,010 --> 00:09:33,720
After reading the number, I will compare that number with the largest.

177
00:09:33,870 --> 00:09:36,990
If the number that we have read is a good then largest.

178
00:09:37,380 --> 00:09:39,270
Then I will update the value of largest.

179
00:09:39,360 --> 00:09:40,880
So largest close to lump.

180
00:09:41,340 --> 00:09:43,110
Otherwise do nothing.

181
00:09:44,280 --> 00:09:45,960
So let's see the flow chart.

182
00:09:46,500 --> 00:09:48,540
Let's see any equals three.

183
00:09:49,680 --> 00:09:50,340
OK, let's see.

184
00:09:50,370 --> 00:09:52,770
And it goes to five and seven.

185
00:09:53,610 --> 00:09:53,870
OK.

186
00:09:54,330 --> 00:09:56,030
So you start then.

187
00:09:56,610 --> 00:09:58,050
Initially I was one.

188
00:09:58,530 --> 00:10:01,920
Largest it was minus infinity.

189
00:10:02,820 --> 00:10:08,460
Then you will come here is one less than it was doing for the condition is true.

190
00:10:08,460 --> 00:10:09,150
You will come here.

191
00:10:09,530 --> 00:10:10,000
Read them.

192
00:10:10,050 --> 00:10:11,340
But I will read five.

193
00:10:11,730 --> 00:10:13,450
So it is five for the largest.

194
00:10:13,680 --> 00:10:15,480
Largest as it was two minus infinity.

195
00:10:15,810 --> 00:10:18,240
So is five greater than a minus infinity.

196
00:10:18,780 --> 00:10:20,070
Yes, the condition is true.

197
00:10:20,190 --> 00:10:20,940
You will come here.

198
00:10:22,490 --> 00:10:26,920
Largest English name, we have doubled the value of largest, so largest.

199
00:10:27,020 --> 00:10:28,710
Is it close to five?

200
00:10:29,600 --> 00:10:32,450
And then you willingly wonder really if I buy one?

201
00:10:32,480 --> 00:10:35,470
So then you little fi is two.

202
00:10:36,440 --> 00:10:39,370
And then you will check again is to list than was to do so.

203
00:10:39,380 --> 00:10:40,330
The condition is true.

204
00:10:40,400 --> 00:10:42,330
You will come here again to them.

205
00:10:42,380 --> 00:10:43,910
But this time we will read.

206
00:10:43,940 --> 00:10:45,730
Seven is seven.

207
00:10:45,740 --> 00:10:46,460
Good then five.

208
00:10:46,610 --> 00:10:46,970
Yes.

209
00:10:47,090 --> 00:10:47,840
Seven is good.

210
00:10:47,930 --> 00:10:49,390
Then five for the condition is true.

211
00:10:49,490 --> 00:10:50,330
You will come here.

212
00:10:51,110 --> 00:10:52,610
You will upgrade the value of largest.

213
00:10:53,140 --> 00:10:54,020
So largest.

214
00:10:55,570 --> 00:10:59,740
It was seven and then you will go in there earlier if I buy one.

215
00:11:00,160 --> 00:11:03,070
So I equals three if you will check the condition.

216
00:11:03,130 --> 00:11:07,600
This Gamla condition becomes false because three is not less than it was.

217
00:11:07,600 --> 00:11:07,930
Two, two.

218
00:11:08,320 --> 00:11:09,350
So the condition is false.

219
00:11:09,490 --> 00:11:10,240
You will come here.

220
00:11:10,480 --> 00:11:11,740
You will print largest.

221
00:11:11,830 --> 00:11:12,940
So seven liberated.

222
00:11:13,240 --> 00:11:15,400
And our output is under eight percent.

223
00:11:15,450 --> 00:11:15,770
Correct.

224
00:11:15,880 --> 00:11:19,930
Because out of five and seven, seven is the largest number.

225
00:11:21,000 --> 00:11:23,370
The trickiest part in this equation is.

226
00:11:24,700 --> 00:11:25,510
This part.

227
00:11:27,380 --> 00:11:30,940
Largest equals minus infinity.

228
00:11:31,720 --> 00:11:32,740
So remember this.

229
00:11:34,280 --> 00:11:35,060
What will you do?

230
00:11:35,540 --> 00:11:39,400
You will initially assume that my largest number is the smallest number.

231
00:11:40,520 --> 00:11:43,490
And then you will try to maximize your largest number.

232
00:11:44,120 --> 00:11:44,380
OK.

233
00:11:44,540 --> 00:11:48,800
So if you want to find the smallest number of this end numbers, what will you do?

234
00:11:50,030 --> 00:11:55,730
You will use a variable smallest and you will initialize it to plus infinity.

235
00:11:56,540 --> 00:11:58,030
So this is tricky part.

236
00:11:59,650 --> 00:12:00,820
So I'm repeating myself.

237
00:12:01,000 --> 00:12:05,080
If you want to find out the smallest of this end numbers, what will you do?

238
00:12:05,380 --> 00:12:10,120
You will use a variable small list and you will initialize smallest to plus infinity.

239
00:12:11,880 --> 00:12:18,000
Here you will check is numb, is then a mother to read is less and smallest.

240
00:12:19,050 --> 00:12:26,190
If this condition is true, you will abrade smallest number, smallest equals numb, otherwise do nothing.

241
00:12:27,210 --> 00:12:32,560
OK, so now we will be solving large problem of part two, problem number three.
