1
00:00:01,770 --> 00:00:03,510
Hey, guys, what's up?

2
00:00:04,080 --> 00:00:11,100
So today we are solving one more interesting problem, so a problem statement is I write a program.

3
00:00:12,530 --> 00:00:21,950
To reverse a number, so we have to write a program to reverse a number, so W8 being WRP means vapid

4
00:00:21,950 --> 00:00:23,200
means, right?

5
00:00:25,100 --> 00:00:25,640
Program,

6
00:00:28,700 --> 00:00:35,490
for example, of the given number is, let's say when 25, some output should be 521.

7
00:00:36,290 --> 00:00:41,180
If the given number is today for some arbitrary forty three.

8
00:00:42,520 --> 00:00:50,920
Similarly, if my input is, let's say five twenty one, some output should be one twenty five.

9
00:00:52,360 --> 00:00:57,170
If they're in four days today to my output should be 23.

10
00:00:57,370 --> 00:00:58,600
So we have to reverse.

11
00:00:58,610 --> 00:00:59,020
No.

12
00:01:00,570 --> 00:01:02,220
So how we can solve this problem?

13
00:01:03,580 --> 00:01:05,170
So the logic is very simple.

14
00:01:06,100 --> 00:01:13,620
So what we do is so what we do is, for example, let's say my value is my number is let's say 32.

15
00:01:15,010 --> 00:01:16,810
So I will find last digit.

16
00:01:18,530 --> 00:01:21,890
And more Ditton will give me the last digit, which is to.

17
00:01:23,880 --> 00:01:24,070
OK.

18
00:01:24,150 --> 00:01:32,560
And I will also maintain a number of laws, which is initially zero, and I will add to the rivers so

19
00:01:32,580 --> 00:01:34,460
rivers will become too.

20
00:01:35,790 --> 00:01:38,610
Now, I will update that number, no question number by 10.

21
00:01:38,670 --> 00:01:40,320
So my new number is three.

22
00:01:40,770 --> 00:01:42,930
Now I will again find the last digit.

23
00:01:43,470 --> 00:01:46,680
So three more then it was three.

24
00:01:47,760 --> 00:01:54,990
And now what I will do, I will write reverse equals reverse plus last digit.

25
00:01:56,460 --> 00:01:58,020
So if you will write this.

26
00:01:58,110 --> 00:01:58,920
So this is wrong.

27
00:01:59,490 --> 00:02:02,580
So in previous example where we have to find the sum of their digits.

28
00:02:03,300 --> 00:02:09,000
So we have written something like a sum equals some plus last digit.

29
00:02:12,500 --> 00:02:18,380
OK, so the idea is very similar to the last problem, but this idea will not work here because if you

30
00:02:18,740 --> 00:02:21,080
reverse is also zero, sum was also zero.

31
00:02:21,920 --> 00:02:23,600
We are again finding the last digit.

32
00:02:23,690 --> 00:02:25,310
We are dividing the number by 10.

33
00:02:25,970 --> 00:02:29,170
But if you if you will write to us, it calls it was blessed last digit.

34
00:02:29,600 --> 00:02:30,500
It will find some.

35
00:02:30,630 --> 00:02:31,310
What will happen?

36
00:02:32,000 --> 00:02:33,240
It will become reverse.

37
00:02:33,290 --> 00:02:34,520
It goes all the way live.

38
00:02:34,520 --> 00:02:34,940
Reverse.

39
00:02:35,450 --> 00:02:35,950
Blessed tree.

40
00:02:36,260 --> 00:02:37,160
It will become five.

41
00:02:39,090 --> 00:02:46,830
So what we should do, reverse it was reverse first multiply two with 10, then add three.

42
00:02:49,590 --> 00:02:52,820
So this will give me twenty three.

43
00:02:54,180 --> 00:03:03,930
So the defense's last example, I did some inkwells someplace, last blizzard here where they will do

44
00:03:04,630 --> 00:03:09,750
a reverse equals reverse, multiply by 10 plus last digit.

45
00:03:13,070 --> 00:03:17,900
This 10 is extra, this multiplication with ten is extra.

46
00:03:18,340 --> 00:03:18,640
OK.

47
00:03:19,880 --> 00:03:25,670
You can also add I did some equals, some multiplied 10 plus last digit.

48
00:03:27,730 --> 00:03:33,640
Is there a difference between the last question and this question is only this multiplication by 10

49
00:03:33,640 --> 00:03:34,060
factor?

50
00:03:35,290 --> 00:03:37,630
So let me show you how it works.

51
00:03:38,560 --> 00:03:43,240
So suppose the value of any is 32 initially made, it was really zero.

52
00:03:43,720 --> 00:03:46,080
So find the last digit, which is two.

53
00:03:46,150 --> 00:03:48,400
So last digit it close to.

54
00:03:50,390 --> 00:03:56,960
So reverse it calls reverse multiply by 10 plus last digit.

55
00:03:58,310 --> 00:03:59,750
So initially reverse is zero.

56
00:03:59,780 --> 00:04:03,400
So zero multiply where ten will be zero and last digit is too.

57
00:04:04,010 --> 00:04:05,000
So reverse is true.

58
00:04:05,300 --> 00:04:06,920
Now, I will update the number.

59
00:04:07,310 --> 00:04:08,660
So my number is three.

60
00:04:09,770 --> 00:04:10,250
How?

61
00:04:10,760 --> 00:04:12,550
Because number is divided by ten.

62
00:04:13,680 --> 00:04:14,960
Now maybe versus two.

63
00:04:15,770 --> 00:04:17,030
So it will be the last widget.

64
00:04:17,210 --> 00:04:22,170
Last digit is three and reverse equals reverse.

65
00:04:22,250 --> 00:04:24,610
Which is to multiply by ten.

66
00:04:25,280 --> 00:04:27,080
Plus the last digit which is three.

67
00:04:27,110 --> 00:04:29,120
So output is 23.

68
00:04:29,690 --> 00:04:31,490
Now update the number.

69
00:04:31,550 --> 00:04:33,410
Number equals number by ten.

70
00:04:33,590 --> 00:04:34,760
So number will become zero.

71
00:04:34,790 --> 00:04:35,700
And I will stop.

72
00:04:37,040 --> 00:04:40,130
And this is my output in variable reverse.

73
00:04:42,260 --> 00:04:47,750
So only this multiplication things extra because we cannot add normally.

74
00:04:48,330 --> 00:04:50,960
OK, now let's take one more example.

75
00:04:51,710 --> 00:04:54,860
Suppose the value of end is 123.

76
00:04:55,670 --> 00:04:57,290
Initially reverse is zero.

77
00:04:57,800 --> 00:05:00,050
Last digit is three.

78
00:05:01,730 --> 00:05:03,250
OK, so the reverse.

79
00:05:03,580 --> 00:05:11,100
It was all really of reverse multiply by ten plus last digit, which is three some outputs, three.

80
00:05:11,470 --> 00:05:12,670
So a reverse history.

81
00:05:13,240 --> 00:05:14,240
Now update the number.

82
00:05:14,260 --> 00:05:15,380
Number will become twelve.

83
00:05:16,620 --> 00:05:19,290
So the reverse is three.

84
00:05:19,840 --> 00:05:21,070
And we're doing the last digit.

85
00:05:21,250 --> 00:05:22,270
It will be two.

86
00:05:23,470 --> 00:05:26,320
So a reverse equals all of reverse.

87
00:05:27,070 --> 00:05:28,040
Multiply by ten.

88
00:05:28,530 --> 00:05:30,010
Blessed last digit, which is two.

89
00:05:30,420 --> 00:05:31,640
So thirty two.

90
00:05:32,380 --> 00:05:33,470
Now update the number.

91
00:05:33,490 --> 00:05:37,080
Number becomes one reverses today.

92
00:05:37,990 --> 00:05:39,310
So what do I last Richard.

93
00:05:39,460 --> 00:05:40,700
It will be one.

94
00:05:41,900 --> 00:05:42,150
OK.

95
00:05:42,490 --> 00:05:45,210
So reverse it because all the value of reverse.

96
00:05:45,310 --> 00:05:49,720
We just had to multiply by ten plus last digit.

97
00:05:49,750 --> 00:05:50,360
Which is one.

98
00:05:51,490 --> 00:05:53,150
So reverses to 21.

99
00:05:54,020 --> 00:05:55,120
Now ablated the number.

100
00:05:55,390 --> 00:05:57,240
So number equals number by ten.

101
00:05:57,520 --> 00:05:59,350
So one by ten is zero point one.

102
00:05:59,410 --> 00:06:01,270
But in upon integer will be integer.

103
00:06:01,300 --> 00:06:02,440
So number equals zero.

104
00:06:02,440 --> 00:06:02,950
Zero means.

105
00:06:03,010 --> 00:06:03,490
Stop.

106
00:06:05,150 --> 00:06:05,540
Stop.

107
00:06:05,620 --> 00:06:09,280
And this is why as a 221 123.

108
00:06:10,710 --> 00:06:12,000
So I think you've heard the logic.

109
00:06:13,140 --> 00:06:14,060
So what we will do?

110
00:06:17,820 --> 00:06:23,810
So initially, my reverse is a zero, right zero, because otherwise it will contain garbage, will

111
00:06:23,830 --> 00:06:24,020
you?

112
00:06:25,460 --> 00:06:33,260
So surveille number is greater than zero whilom, but is not to close to zero or whilom, but it is

113
00:06:33,260 --> 00:06:33,850
a good thing zero.

114
00:06:33,920 --> 00:06:34,880
They're both the same.

115
00:06:35,600 --> 00:06:37,220
We have to find last digit.

116
00:06:37,750 --> 00:06:41,480
So last digit equals no more than now.

117
00:06:41,480 --> 00:06:49,970
We've got the last digit and reverse equals reverse and multiply it by 10 plus last digit.

118
00:06:52,160 --> 00:06:55,830
And then we have to update the number, number, request number by ten.

119
00:06:56,900 --> 00:07:01,040
And finally, our output will be Reavers.

120
00:07:01,970 --> 00:07:04,770
So this is the code that we have to write.

121
00:07:05,810 --> 00:07:08,390
Okay, so the logic is very simple.

122
00:07:09,350 --> 00:07:13,010
In case of some head, it was some equals zero.

123
00:07:13,040 --> 00:07:19,010
And I heard it was some it equals some plus last digit rest.

124
00:07:19,160 --> 00:07:20,660
All things were the same.

125
00:07:20,870 --> 00:07:23,510
And here I was having see out some.

126
00:07:25,620 --> 00:07:33,410
And some so this you can compare just we have changed the very real name because in the previous problem

127
00:07:33,420 --> 00:07:38,370
and we won't talk, I read some hatred on Caligula was suggested the name of the variable is changed.

128
00:07:38,760 --> 00:07:42,030
The main differences, we are multiplying by ten now.

129
00:07:43,380 --> 00:07:43,600
OK.

130
00:07:43,750 --> 00:07:44,920
So this is the main difference.

131
00:07:45,370 --> 00:07:46,420
So let us ride called.

132
00:07:52,720 --> 00:07:56,800
So now it does name this file is reverse.

133
00:07:59,760 --> 00:08:00,240
Off.

134
00:08:01,710 --> 00:08:04,290
No, not CPV.

135
00:08:16,230 --> 00:08:22,530
So now what I have to do, I will take a number and and put fundi, use it.

136
00:08:24,260 --> 00:08:28,260
I am taking a variable in reverse, which is initially zero.

137
00:08:29,010 --> 00:08:33,510
So while my number is greater than zero.

138
00:08:34,170 --> 00:08:35,010
What I have to do.

139
00:08:38,630 --> 00:08:41,010
I have to find the last digit first.

140
00:08:41,220 --> 00:08:50,370
So end last night, it equals no more then.

141
00:08:50,460 --> 00:09:03,120
So do you give me the last budget and reverse equals halo's multiplied by 10 plus last digit.

142
00:09:05,040 --> 00:09:12,720
And then we have to update our number, so, no, it was number by then.

143
00:09:14,760 --> 00:09:16,350
And finally, I will print.

144
00:09:17,170 --> 00:09:20,460
He was Soucy out reverse.

145
00:09:21,590 --> 00:09:24,020
OK, so this is all that we have to do.

146
00:09:26,330 --> 00:09:28,520
Now, let us test our program.

147
00:09:30,910 --> 00:09:37,080
So let's say the value of and is 123, so our parties to twenty one.

148
00:09:39,210 --> 00:09:44,490
Let's say my input is, well, same output is twenty one.

149
00:09:47,170 --> 00:09:52,750
So if the value of friend is, let's say, three, six, five, four, some output is four, five,

150
00:09:52,840 --> 00:09:53,710
six, three.

151
00:09:55,280 --> 00:09:56,620
Now, let us bastard.

152
00:09:56,850 --> 00:09:57,660
Well, last time.

153
00:10:01,050 --> 00:10:03,560
So let's hear my input is hindered.

154
00:10:04,140 --> 00:10:09,690
So what should be my output, my output should be zero zero one.

155
00:10:10,480 --> 00:10:12,390
But let's see what will be my output.

156
00:10:13,050 --> 00:10:16,230
So my output is coming out to be one.

157
00:10:19,580 --> 00:10:27,980
So if the number is a hundred, my output should be zero zero one, but it is coming out to be when?

158
00:10:29,500 --> 00:10:30,550
How so?

159
00:10:30,710 --> 00:10:34,740
Let us right in our program to see what went wrong.

160
00:10:40,700 --> 00:10:45,910
So my number and is hindered initially.

161
00:10:46,520 --> 00:10:48,290
Reverse is zero.

162
00:10:48,920 --> 00:10:50,690
And so what will be my last digit?

163
00:10:50,900 --> 00:10:52,490
Last digit will be zero.

164
00:10:53,270 --> 00:11:01,610
So reverse it was reverse, multiply by 10 plus last digit, which is zero.

165
00:11:02,120 --> 00:11:05,150
Now update the value and will become 10.

166
00:11:06,070 --> 00:11:08,000
So the reverse is zero.

167
00:11:08,570 --> 00:11:10,880
Last digit is again zero.

168
00:11:11,690 --> 00:11:14,180
And reverse is a reverse.

169
00:11:14,480 --> 00:11:18,480
Multiply it by 10 plus last digit.

170
00:11:19,050 --> 00:11:20,760
So reverses again zero.

171
00:11:21,140 --> 00:11:22,310
Now update the numbers.

172
00:11:22,310 --> 00:11:23,960
A number becomes one.

173
00:11:25,100 --> 00:11:25,840
Reverses.

174
00:11:26,090 --> 00:11:26,600
Zero.

175
00:11:26,990 --> 00:11:28,340
So what will be my last digit?

176
00:11:28,550 --> 00:11:29,480
Which is one.

177
00:11:30,520 --> 00:11:33,080
So a reverse equals reverse.

178
00:11:33,440 --> 00:11:36,890
Multiply by ten plus the last digit.

179
00:11:37,240 --> 00:11:41,300
So my reverses, when not update the number number will become zero.

180
00:11:41,690 --> 00:11:45,440
I will stop and my output will be one.

181
00:11:45,920 --> 00:11:46,990
So that is the reason.

182
00:11:47,420 --> 00:11:48,990
When is my output.

183
00:11:50,950 --> 00:11:51,320
Margaret.

184
00:11:52,260 --> 00:11:54,090
So how we can solve this problem?

185
00:11:54,390 --> 00:11:54,960
Any idea?

186
00:11:57,720 --> 00:12:00,160
So we can solve this problem, but we will lose.

187
00:12:00,540 --> 00:12:02,450
So first, let us come into doubt.

188
00:12:05,030 --> 00:12:11,270
So this solution that we have commented, so this solution that we are committed at is absolutely fine.

189
00:12:11,810 --> 00:12:17,420
No one will check gold 400 at least in your college or in your school.

190
00:12:17,510 --> 00:12:18,530
No one is gonna check.

191
00:12:19,070 --> 00:12:20,960
So this court is hundred percent correct.

192
00:12:21,710 --> 00:12:23,480
But what extra you can do is.

193
00:12:26,630 --> 00:12:30,590
You just find the last digit and just print the last digit.

194
00:12:31,520 --> 00:12:36,860
So while limbered is good in zero, just print the last digit.

195
00:12:36,980 --> 00:12:41,100
So she wrote last digit, which is no more than.

196
00:12:43,440 --> 00:12:46,760
And number equals number by an.

197
00:12:49,790 --> 00:12:50,600
Now, that is all.

198
00:12:54,480 --> 00:12:59,550
As soon as you find the last digit, as soon as you find the last digit just printed.

199
00:13:00,870 --> 00:13:07,830
So a guest star program led to the release of 123 so Tilda and doing find the last digit and Brent.

200
00:13:10,490 --> 00:13:11,770
Let them my in four days.

201
00:13:12,040 --> 00:13:14,330
Three, two, one, three, two, five, six, four.

202
00:13:14,870 --> 00:13:16,900
So Margaret is four, six, five, two, three.

203
00:13:17,620 --> 00:13:19,690
And now let's say my input is handed.

204
00:13:20,530 --> 00:13:21,490
My input is handed.

205
00:13:21,550 --> 00:13:24,430
So my output is zero zero one, which is correct.

206
00:13:25,590 --> 00:13:30,340
So how it is working, let's say, for any quiz?

207
00:13:30,390 --> 00:13:31,290
123.

208
00:13:31,560 --> 00:13:32,430
So what did we do?

209
00:13:32,490 --> 00:13:34,680
Find the last digit, which is three Braintree.

210
00:13:36,240 --> 00:13:38,030
Normally we come to Brent.

211
00:13:38,220 --> 00:13:38,820
Last digit.

212
00:13:39,060 --> 00:13:44,100
So 22 printed upbraid the number normally come when find the last resort.

213
00:13:44,220 --> 00:13:46,860
And Brent when number really becomes zero.

214
00:13:47,040 --> 00:13:47,820
This is my answer.

215
00:13:48,570 --> 00:13:54,990
When I leave, the value of Andy's is hundred branded the last digit zero upbraid the number normally

216
00:13:54,990 --> 00:13:55,540
become 10.

217
00:13:55,890 --> 00:13:58,760
Brent, the last digit update number.

218
00:13:59,200 --> 00:14:01,200
Ben, the last digit update.

219
00:14:01,230 --> 00:14:03,220
The number number becomes zero.

220
00:14:03,360 --> 00:14:03,780
Stop.

221
00:14:04,500 --> 00:14:08,880
This is my output for near-term output is coming out with zero zero one.

222
00:14:10,330 --> 00:14:17,530
OK, so just we are printing the last digit and more, ten and more means the last digit.

223
00:14:21,720 --> 00:14:27,720
OK, this is last digit, but there is a problem with this solution.

224
00:14:28,770 --> 00:14:29,780
So what is the problem?

225
00:14:31,380 --> 00:14:40,320
So, for example, what I want to do is after finding that it was I want to perform some operation on

226
00:14:40,320 --> 00:14:40,790
the reverse.

227
00:14:41,760 --> 00:14:45,300
So in this case, I am not starting that rehearsed number.

228
00:14:45,360 --> 00:14:48,930
So how can I perform operation on the reverse of the number?

229
00:14:50,320 --> 00:14:56,520
Here in this case, if you want to perform some operation, we can write, for example, reverse equals

230
00:14:56,850 --> 00:14:59,380
reverse, plus anything that you want to do.

231
00:14:59,400 --> 00:15:00,800
For example, add Dwil.

232
00:15:01,170 --> 00:15:05,490
So here I can do I can add two L to the reverse of the number.

233
00:15:06,040 --> 00:15:08,230
But here in this case.

234
00:15:09,090 --> 00:15:16,020
I haven't installed the reverse of the number, so I cannot add it to L in this code.

235
00:15:17,160 --> 00:15:20,500
OK, so if someone asks you, which is the correct approach.

236
00:15:20,910 --> 00:15:22,680
So I Bovin is correct approach.

237
00:15:22,720 --> 00:15:24,750
And this is not correct approach.

238
00:15:25,260 --> 00:15:26,160
So this is correct.

239
00:15:26,190 --> 00:15:32,400
The second approach is correct only when the question was just to print reverse of a number.

240
00:15:33,970 --> 00:15:34,210
OK.

241
00:15:34,520 --> 00:15:44,580
So if the question was so if the question was just print the reverse of no, just print reverse.

242
00:15:45,770 --> 00:15:51,410
My question is just print reverse, then this cord is hundred percent correct.

243
00:15:54,470 --> 00:16:02,450
But if the cautions sees, write a program to find the reverse of the number and add 10 to the number

244
00:16:02,510 --> 00:16:03,820
and then print reserved.

245
00:16:04,850 --> 00:16:05,120
OK.

246
00:16:05,780 --> 00:16:11,120
If caution is something like this, find the reverse of the number and attend to the number and then

247
00:16:11,270 --> 00:16:12,110
print the result.

248
00:16:12,650 --> 00:16:19,040
So this is much a better approach because here we are having the number stored in my variable reverse.

249
00:16:19,100 --> 00:16:22,800
So we can add what we can perform any operation or net them.

250
00:16:22,880 --> 00:16:29,450
But so if in university exam, anyone ask you to find the reverse of the number, the first approach

251
00:16:29,450 --> 00:16:30,050
is correct.

252
00:16:31,220 --> 00:16:32,360
Second approach is wrong.

253
00:16:34,440 --> 00:16:34,720
OK.

254
00:16:35,300 --> 00:16:38,240
So teacher will give you marks only when you write this call.

255
00:16:38,860 --> 00:16:40,490
They will not give your marks for this call.

256
00:16:44,010 --> 00:16:50,390
So that means if I had the first call for any quiz, hundred more bodies.

257
00:16:50,700 --> 00:16:52,920
Again, when so can resolve this problem.

258
00:16:54,480 --> 00:16:55,650
Can we solve this problem?

259
00:17:01,970 --> 00:17:02,790
What I'm saying.

260
00:17:03,980 --> 00:17:11,260
I am telling you to follow this approach, word for any was handed, it is giving me one as output when

261
00:17:11,300 --> 00:17:13,110
asked to correct outproduce zero zero one.

262
00:17:13,330 --> 00:17:14,710
So can we solve this problem?

263
00:17:15,040 --> 00:17:17,730
So the answer is yes, we can solve this problem.

264
00:17:18,220 --> 00:17:22,030
Myrt, with the current knowledge that we have, we cannot solve this problem.

265
00:17:24,430 --> 00:17:27,730
We have to study Eddi for solving this problem.

266
00:17:29,440 --> 00:17:29,680
OK.

267
00:17:29,800 --> 00:17:35,560
So with the help of very this best case, finanical sended, this can be sold.

268
00:17:36,630 --> 00:17:37,540
When we study, Eddie.

269
00:17:38,350 --> 00:17:45,960
So after starting the Eddie, we really mortified discord and discord will work for an equals hundred

270
00:17:45,990 --> 00:17:46,520
as well.

271
00:17:48,440 --> 00:17:48,730
OK.

272
00:17:49,250 --> 00:17:52,580
So there is one more interesting thing that I want to tell you.

273
00:17:53,270 --> 00:18:02,660
So remember I told you something like I told you did in beta is of four bytes and what is my limit quoted?

274
00:18:02,720 --> 00:18:07,400
About 30 went to minus one to minus two to the power to do.

275
00:18:07,400 --> 00:18:10,970
And this was the range of the integer.

276
00:18:11,390 --> 00:18:14,570
And I don't do remember that it is ten to the power.

277
00:18:14,570 --> 00:18:15,230
Nine digits.

278
00:18:17,990 --> 00:18:18,680
Nine digits.

279
00:18:18,710 --> 00:18:19,300
You can remember.

280
00:18:19,400 --> 00:18:24,790
Okay, so this number I also told you that this number has a name intermix.

281
00:18:27,050 --> 00:18:28,910
So what will happen if you reverse.

282
00:18:29,150 --> 00:18:30,640
If you reverse intermix?

283
00:18:32,090 --> 00:18:32,750
What will happen.

284
00:18:33,320 --> 00:18:34,970
So there will be integer overflow.

285
00:18:35,420 --> 00:18:36,140
Let me show you.

286
00:18:39,060 --> 00:18:40,140
Just remove it.

287
00:18:42,360 --> 00:18:43,580
Let's see the value of it.

288
00:18:43,780 --> 00:18:44,930
And is intermix.

289
00:18:48,450 --> 00:18:50,940
And Dumex me is true, the boat do and minus one.

290
00:18:51,000 --> 00:18:52,400
So the real friend is intermix.

291
00:18:53,700 --> 00:18:57,660
And let's say for the time being, Commander Daoud.

292
00:19:01,760 --> 00:19:03,520
And let us try to bring the valley off.

293
00:19:03,570 --> 00:19:05,520
And so she yelled.

294
00:19:07,230 --> 00:19:11,720
And now let's see what is the value of intermix.

295
00:19:13,700 --> 00:19:16,330
That makes in a murder can we can stored in India.

296
00:19:17,000 --> 00:19:20,030
So this is the maximum number undertaken store in India.

297
00:19:23,310 --> 00:19:32,130
OK, so two one four seven four eight three, six, four and seven.

298
00:19:32,670 --> 00:19:34,430
So this is endemics.

299
00:19:37,350 --> 00:19:40,000
Or against a two to the power tactic, one minus one.

300
00:19:40,390 --> 00:19:41,860
So this is the maximum number.

301
00:19:41,980 --> 00:19:48,300
This is the maximum number of dirt I can store in four bytes or a 32 bids.

302
00:19:50,260 --> 00:19:53,050
So what will happen if you try to reverse this number?

303
00:19:53,500 --> 00:20:04,300
So what is the reverse of this number seven forward six three eight four seven forward one two.

304
00:20:04,660 --> 00:20:07,390
So this is the reverse of this number.

305
00:20:08,110 --> 00:20:09,010
Now, tell me.

306
00:20:09,280 --> 00:20:11,500
Let's say this is an Atlanta decision was.

307
00:20:14,440 --> 00:20:15,820
So have you observed one thing?

308
00:20:15,910 --> 00:20:17,590
Reverse is greater than the number.

309
00:20:19,270 --> 00:20:20,920
This is a starting from two.

310
00:20:20,980 --> 00:20:22,660
And this is starting from seven.

311
00:20:23,200 --> 00:20:24,700
And the number of digits, I seem.

312
00:20:28,770 --> 00:20:36,300
So a starting point here is to and starting point here is seven and the number of digits in both and

313
00:20:36,390 --> 00:20:40,700
and reverse are seem so reverse is good then.

314
00:20:40,770 --> 00:20:44,470
And that we can see that we can that we are observing.

315
00:20:44,820 --> 00:20:49,110
But I told you that the maximum number that we can store is this number.

316
00:20:49,920 --> 00:20:52,940
So how we can store this number in four bytes.

317
00:20:54,180 --> 00:20:56,400
How we can store this number in four bytes.

318
00:20:56,550 --> 00:20:58,560
So the answer is we cannot store.

319
00:21:00,830 --> 00:21:02,390
OK, so what will happen?

320
00:21:02,840 --> 00:21:04,130
So this is intermix.

321
00:21:06,800 --> 00:21:13,220
So as soon as you will try you, as soon as you will find a number greater than intermix.

322
00:21:13,580 --> 00:21:19,200
So I told you, wrap around so intermixed plus one, we will reach into a minimum.

323
00:21:21,720 --> 00:21:22,010
OK.

324
00:21:22,430 --> 00:21:26,690
So as soon as you will cross the valley of Intermix, you will reach into minimum.

325
00:21:28,370 --> 00:21:32,120
So this number will not get benter in Strood.

326
00:21:32,210 --> 00:21:33,380
A negative number.

327
00:21:33,710 --> 00:21:37,740
A negative number will be Hmoud put out a negative number.

328
00:21:37,850 --> 00:21:40,720
Will be my output.

329
00:21:42,300 --> 00:21:42,690
Why?

330
00:21:42,830 --> 00:21:45,080
Because I wrap around.

331
00:21:46,670 --> 00:21:55,760
We take place and via it happened will take place because the reverse is greater than the number.

332
00:21:56,150 --> 00:21:58,460
And this number is endemics.

333
00:22:00,560 --> 00:22:02,770
So the reverse is greater than intermix.

334
00:22:03,250 --> 00:22:07,120
Hence it will reach into minimum minus two to the power 31.

335
00:22:07,220 --> 00:22:07,850
Minus one.

336
00:22:08,440 --> 00:22:08,730
OK.

337
00:22:09,470 --> 00:22:11,030
So negative number value output.

338
00:22:11,240 --> 00:22:12,440
This is this thing clear.

339
00:22:12,560 --> 00:22:14,870
So we call this thing as in digit overflow.

340
00:22:15,720 --> 00:22:17,240
In deja overflow.

341
00:22:19,430 --> 00:22:21,100
This thing is called and dijo and flow.

342
00:22:21,590 --> 00:22:22,550
So let me show you.

343
00:22:29,820 --> 00:22:33,030
Now, let us find the reverse of intermix.

344
00:22:34,920 --> 00:22:36,510
Noller does test our program.

345
00:22:39,040 --> 00:22:45,020
So you can see here, this was my number and this is the reverse of the above number.

346
00:22:45,640 --> 00:22:52,780
And it is negative via negative because in digital of law is there wrap around is taking place.

347
00:22:54,630 --> 00:22:54,920
OK.

348
00:22:55,890 --> 00:23:03,950
So I hope you got the logic, but don't worry, these kinds of things will never be asked in college

349
00:23:03,950 --> 00:23:05,310
or high school, high school exams.

350
00:23:06,090 --> 00:23:12,120
But these things may be axed in interviews of top tech companies, for example, Google, Facebook,

351
00:23:12,660 --> 00:23:14,730
Amazon, Microsoft.

352
00:23:15,650 --> 00:23:15,830
OK.

353
00:23:15,930 --> 00:23:18,660
So you have to take care of these things also.

354
00:23:19,190 --> 00:23:21,330
I am not covering how to handle this case.

355
00:23:22,550 --> 00:23:23,680
I will cover it later.

356
00:23:25,290 --> 00:23:28,170
But you should know when winning the general will take place.

357
00:23:28,880 --> 00:23:29,110
OK.

358
00:23:29,670 --> 00:23:30,960
So just open your mind.

359
00:23:31,110 --> 00:23:33,630
Think of all the possibilities that can happen.

360
00:23:36,460 --> 00:23:37,090
OK, guys.

361
00:23:37,140 --> 00:23:40,330
So this is it for this video.

362
00:23:41,200 --> 00:23:41,630
Thank you.
