Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,270 --> 00:00:00,840
All right.
2
00:00:00,870 --> 00:00:05,970
So welcome back goes through another challenge, and this challenge is actually pretty similar to the
3
00:00:05,970 --> 00:00:06,750
previous one.
4
00:00:07,110 --> 00:00:12,840
What we are going to do here is simply to write the recursive function that will receive a number of
5
00:00:12,840 --> 00:00:15,620
some Nahm, just like we've done previously.
6
00:00:15,810 --> 00:00:21,060
But now, instead of finding out what will be the sum of all digits in a given number, what we are
7
00:00:21,060 --> 00:00:26,370
going to find out is what is the total number of digits in these given numbers.
8
00:00:26,580 --> 00:00:31,270
So, for example, if we have a Nahm as 67, as we said previously.
9
00:00:31,470 --> 00:00:37,320
So what the recursive function is going to do now is simply to return the total amount of digits.
10
00:00:37,560 --> 00:00:42,810
So if we know that sixty seven consists of six and seven, which is just two digits.
11
00:00:42,990 --> 00:00:47,480
So the result of this function, the return value is going to be two.
12
00:00:47,670 --> 00:00:53,880
And as the second example that we use previously, we have Nahmias, nine thousand five hundred thirty
13
00:00:53,880 --> 00:00:54,240
one.
14
00:00:54,420 --> 00:00:57,070
So how you calculate the total amount of digits.
15
00:00:57,480 --> 00:00:59,180
You simply find out why.
16
00:00:59,730 --> 00:00:59,980
How.
17
00:01:00,060 --> 00:01:02,220
How many digits of this number has.
18
00:01:02,280 --> 00:01:02,610
Okay.
19
00:01:02,910 --> 00:01:09,510
Just by using this approach that we've shown in the previous challenge, just by dividing by 10 on every,
20
00:01:09,750 --> 00:01:16,710
let's say, a recursive call and then taking just one digit and using some are some mechanism that we
21
00:01:16,710 --> 00:01:17,130
know.
22
00:01:17,430 --> 00:01:18,660
We take it into account.
23
00:01:18,660 --> 00:01:21,810
So previously we took the whole digit into account.
24
00:01:21,840 --> 00:01:22,740
We summed it up.
25
00:01:23,070 --> 00:01:26,580
And now we simply are going probably to use some counter.
26
00:01:26,610 --> 00:01:27,920
But I'll leave it to you guys.
27
00:01:27,920 --> 00:01:28,160
Okay.
28
00:01:28,440 --> 00:01:30,090
So take your time to think about it.
29
00:01:30,270 --> 00:01:35,970
It's pretty similar to the previous exercise, but it also are kind of different.
30
00:01:36,270 --> 00:01:37,050
So take your time.
31
00:01:37,080 --> 00:01:40,470
Think of the solution and I'll see you in the Solutions video.
32
00:01:40,800 --> 00:01:41,440
Good luck, guys.
2815
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.