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

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
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
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian Download
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

What is going on, ladies and gentlemen, and in this exercise, what we are going to do is basically

to write a simple program, make some logic, OK, so we have a program and these programs should work

on an array and let's say we will have some array.

You will have some array of values.

And what do you have to do is to print, print, want print of some?

Of two elements.

In this array of two elements.

That is.

That is the most close.

Two zero.

So, for example, we have these array.

Let's see one, two, three four elements, we have one, we have minus two, we have two, we have

three.

OK, so we are looking for a pair of values that there are some will be closest to zero.

And what do you need to understand?

And that's basically what you need to solve is that let's say we have here is zero.

We have positive numbers, right?

We have here positive numbers, positive values and we also have negative values negative.

Right.

So what would you need to understand is where are you closer to zero?

So if we take one and minus two, we will get a sum of minus one.

If we take one and two, we will get a sum of three.

If we take one in three, we'll get a sum of four.

Then we can take minus two plus one.

We already know the result minus 2+2 will give us zero right minus two plus three will give us one.

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

within an array.

OK, we need to take the sum of any two elements and find which of these sums that will be generated

from this array.

Sorry, will be the closest to zero.

OK, so which one of them and the way you compare between minus one and one, for example, you always

know, let's say that two is greater than minus one.

Or that basically you need a way to find out how you find the closeness to zero from both sides from

positive and negative.

And for that, you can use either some logic.

If a number is negative, let's multiplied by one to find out in comparison to where it stands for the

positive number.

Or you can simply use the ABS function for any value, and this function should return the absolute

value.

The absolute value for a given number that you are going to provided here.

OK.

So yeah, these are the instructions pretty much guiding you to solving this exercise.

So try it on your own, give it your best.

And once you're done, I'll see you in the solutions VIDEO.

Thank you so much.

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