All language subtitles for 17. A Program to Find Two elements whose Sum is Closest to Zero - Question

af Afrikaans
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bn Bengali
bs Bosnian
bg Bulgarian
ca Catalan
ceb Cebuano
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
tl Filipino
fi Finnish
fr French
fy Frisian
gl Galician
ka Georgian
de German
el Greek
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian Download
is Icelandic
ig Igbo
id Indonesian
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
km Khmer
ko Korean
ku Kurdish (Kurmanji)
ky Kyrgyz
lo Lao
la Latin
lv Latvian
lt Lithuanian
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mn Mongolian
my Myanmar (Burmese)
ne Nepali
no Norwegian
ps Pashto
fa Persian
pl Polish
pt Portuguese
pa Punjabi
ro Romanian
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
st Sesotho
sn Shona
sd Sindhi
si Sinhala
sk Slovak
sl Slovenian
so Somali
es Spanish
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
te Telugu
th Thai
tr Turkish
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
or Odia (Oriya)
rw Kinyarwanda
tk Turkmen
tt Tatar
ug Uyghur
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:02,410 --> 00:00:07,600 What is going on, ladies and gentlemen, and in this exercise, what we are going to do is basically 2 00:00:07,600 --> 00:00:14,530 to write a simple program, make some logic, OK, so we have a program and these programs should work 3 00:00:14,530 --> 00:00:18,240 on an array and let's say we will have some array. 4 00:00:18,250 --> 00:00:20,530 You will have some array of values. 5 00:00:20,860 --> 00:00:26,320 And what do you have to do is to print, print, want print of some? 6 00:00:28,640 --> 00:00:29,960 Of two elements. 7 00:00:31,550 --> 00:00:33,500 In this array of two elements. 8 00:00:34,850 --> 00:00:35,810 That is. 9 00:00:38,290 --> 00:00:40,300 That is the most close. 10 00:00:42,720 --> 00:00:43,470 Two zero. 11 00:00:46,430 --> 00:00:48,380 So, for example, we have these array. 12 00:00:50,150 --> 00:00:56,810 Let's see one, two, three four elements, we have one, we have minus two, we have two, we have 13 00:00:56,810 --> 00:00:57,260 three. 14 00:00:58,340 --> 00:01:04,880 OK, so we are looking for a pair of values that there are some will be closest to zero. 15 00:01:05,570 --> 00:01:07,100 And what do you need to understand? 16 00:01:07,100 --> 00:01:11,090 And that's basically what you need to solve is that let's say we have here is zero. 17 00:01:11,750 --> 00:01:13,820 We have positive numbers, right? 18 00:01:13,820 --> 00:01:20,480 We have here positive numbers, positive values and we also have negative values negative. 19 00:01:21,380 --> 00:01:21,710 Right. 20 00:01:22,280 --> 00:01:27,920 So what would you need to understand is where are you closer to zero? 21 00:01:28,370 --> 00:01:33,170 So if we take one and minus two, we will get a sum of minus one. 22 00:01:33,680 --> 00:01:36,930 If we take one and two, we will get a sum of three. 23 00:01:37,280 --> 00:01:40,100 If we take one in three, we'll get a sum of four. 24 00:01:41,240 --> 00:01:43,760 Then we can take minus two plus one. 25 00:01:43,760 --> 00:01:51,350 We already know the result minus 2+2 will give us zero right minus two plus three will give us one. 26 00:01:52,310 --> 00:02:00,020 So that's how you do it, and you can find out that there are a lot of pairs of sums that we can find 27 00:02:00,020 --> 00:02:01,130 within an array. 28 00:02:01,160 --> 00:02:09,140 OK, we need to take the sum of any two elements and find which of these sums that will be generated 29 00:02:09,140 --> 00:02:09,860 from this array. 30 00:02:09,860 --> 00:02:13,760 Sorry, will be the closest to zero. 31 00:02:14,800 --> 00:02:22,030 OK, so which one of them and the way you compare between minus one and one, for example, you always 32 00:02:22,030 --> 00:02:26,830 know, let's say that two is greater than minus one. 33 00:02:27,130 --> 00:02:36,670 Or that basically you need a way to find out how you find the closeness to zero from both sides from 34 00:02:36,670 --> 00:02:37,750 positive and negative. 35 00:02:38,440 --> 00:02:41,500 And for that, you can use either some logic. 36 00:02:41,530 --> 00:02:49,000 If a number is negative, let's multiplied by one to find out in comparison to where it stands for the 37 00:02:49,000 --> 00:02:49,780 positive number. 38 00:02:50,020 --> 00:02:59,230 Or you can simply use the ABS function for any value, and this function should return the absolute 39 00:02:59,230 --> 00:02:59,980 value. 40 00:03:01,240 --> 00:03:08,110 The absolute value for a given number that you are going to provided here. 41 00:03:08,500 --> 00:03:08,950 OK. 42 00:03:09,610 --> 00:03:15,520 So yeah, these are the instructions pretty much guiding you to solving this exercise. 43 00:03:15,970 --> 00:03:18,760 So try it on your own, give it your best. 44 00:03:18,760 --> 00:03:22,270 And once you're done, I'll see you in the solutions VIDEO. 45 00:03:22,750 --> 00:03:23,590 Thank you so much. 4096

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.