• 3 days ago
Transcript
00:00Next question, which we will talk about is Indian coins, so this is the question, we have a lot of
00:05coins, or infinite supply, coins or notes, so there are a lot of notes, so there are a lot of
00:12notes, so in greedy, there is a question of money, so infinite supply, we have a lot of denominations, which
00:20we put in Indian currency,
00:22such as I have not included 200 notes, because it is new, this is the question very first, basically, which
00:29denominations, we have 1, 2, 5, 10, 20, 50, 100, 500, 2000, and here I have infinite supply denominations,
00:38where I have a minimum number of coins or notes to find out, which I can make a change of
00:43any value of V, this means, if we go to a cab, to a rickshaw, to a bus, to a
00:52metro,
00:52if we go to a cab, if we ask 90 rupees, then what do we usually do, we don't think
00:58that we don't think 1, 1, 1, we give 90 copies, so we don't have so many copies,
01:03or then we give 10, 10, we give 9 notes, usually what do we do, first we give the biggest
01:09notes available,
01:10that if I give 90 rupees, then what do I do, I give 50 notes, then I give 20, 20,
01:16I give 2 notes, so I have a total of 90 rupees,
01:19which I have a deal with, so usually in our mind has the process, the process of this kind is
01:23the process,
01:24and this is a greedy process from a gree-dy process, look for a few examples,
01:28as if I suppose someone gave me a change of 121, I have to make 121 rupees,
01:33or this value of equal to the value, so how do I show them,
01:37I first give 100 rupees notes of this currency, because in this currency, what is available,
01:43this is the smallest, first of the hundred, then I will give them 20 rupees,
01:47I will give a 1.00 per cent and then I will give a 1.00 per cent.
01:51So, the total value of this is 121.
01:53And how many coins and notes I have used,
01:56how many can I use?
01:583.
01:59Maximum, how many?
02:00If I give a maximum way,
02:03what will I do?
02:03I will give a 1001.00 per cent.
02:05But that will not be a practical way.
02:07Practical way will be that I will change the minimum coins and minimum notes
02:10from the total value.
02:12So, here the answer is 3.
02:14In addition to that, there is another example that
02:17if I give a 590.00 per cent.
02:21So, how can I give a less coins and notes?
02:24First, I will give a 500.00 per cent.
02:26Then I will give a 50.00 per cent.
02:28Then I will give a 20.00 per cent.
02:30So, I will give a total value of 5.90.00 per cent.
02:34So, here the answer will be 4.00 per cent.
02:36Now, the problem is that
02:39all number systems or coin systems do not work for the number system.
02:43That means, this coin system,
02:45which we will apply for greedy approach,
02:47that will only work for this coin system.
02:49This same question,
02:50you will think that
02:51I have bought a new island,
02:53which I have opened a new country.
02:55In the country,
02:56now I have 1,
02:585,
02:58and I have 100,
03:00and now I have to solve the same question.
03:03I have to solve the same question.
03:12Which systems work for greedy approach?
03:15Those systems we call canonical.
03:18Canonical coin system,
03:20or canonical number systems we call.
03:22So, the Indian currency system is canonical.
03:27That's why we can solve this question on greedy approach.
03:29So, we can solve this question.
03:31There will be some systems that we can solve this question.
03:35Now, let's talk about intuition.
03:37First of all,
03:37which approach we use to solve this question?
03:40Let's say,
03:41I have a 5.90 case.
03:43Intuitively,
03:44what happens in our mind,
03:45because we are greedy,
03:47and what happens in our mind,
03:48what happens in our mind,
03:49what happens in our mind,
03:49what happens in our mind,
03:59what happens in our mind,
03:59we have to solve this question.
04:00If we ask somebody,
04:01if we give somebody 590,
04:02then,
04:02I will give somebody less effort.
04:04I will give them 500.
04:07I will give them 500.
04:08The maximum value of a single goal.
04:11Then,
04:11I will get to know that
04:13I have 90.
04:14Then,
04:15I will give them 90.
04:15Then,
04:16I will give them 50.
04:17I will give them more.
04:18Because,
04:19I will give 100,
04:19If I will give them 50,
04:20and I will give them 40,
04:24then,
04:25I will give them 40.
04:25I will give them 40.
04:28I can give a 20 note.
04:28I can give a 20 note,
04:31it has already been left.
04:32Now I think that I will give a 20 more,
04:34then this will cover.
04:36If I give a 20 more note,
04:37it will be 0.
04:38So, I will give a 20 more,
04:40as I will give a 20 more,
04:41I will give a maximum possible
04:45and I will give it
04:47until the final value is 0.
04:51So, if I have currencies in Indian system,
04:54there are many currencies,
04:561, 2, 5, 10,
04:5820, 50, 100,
05:00this way,
05:02so, the first work is to sort
05:04in descending order.
05:06I mean, first,
05:072000, 500, 100,
05:11then 50,
05:13then 20, 10, 5,
05:16then 2, and then 1.
05:19So, this way,
05:20I will sort my currencies
05:22in descending order.
05:23Now, if I have a change for 590,
05:27then I will go ahead and see it.
05:29If I give this value,
05:31it will become 590?
05:32No, it will be much more.
05:34So, this is the value
05:35from this value.
05:36So, it will not give it.
05:37If I give this value,
05:39I will give this value.
05:40If I give this value,
05:41it will not give it.
05:41If I give this value,
05:43I will give this value.
05:44I will give this value.
05:46It will be much more than 90?
05:4790 will be much more than 90?
05:48If I give this value?
05:50No.
05:51Then, I can give 100?
05:52If I give this value?
05:53100,
05:54it will increase this value.
05:55100 will not be able to give it.
05:56Then, I can give 50?
05:5750 will give it.
05:58I can give 50?
05:59I have given 50 note.
06:01Now, this value will be much higher than 40.
06:03Then, I will ask again 50,
06:05if I give 50?
06:06No.
06:0650 will not give it.
06:08It will increase the value.
06:09Now, I will ask 20 from 20.
06:10I can use 20 notes again? Yes, I can use 20 notes again. I can use 20 notes again, so
06:14I will give 20 notes again.
06:17Now, I will ask 20 notes again. Can I give 20 notes again? Yes, I can give 20 notes again.
06:24I will give 20 notes again, and my value is less than 0. Now, if 0 is value, it means
06:31that I don't give anyone else.
06:32So, how many notes used? 4 notes used. Which ones? 1 500, 1 50 and 2 I have 20 notes.
06:38So, in this way, I have a change for my currency. In minimum number of notes and coins.
06:45So, here I have this logic that if I have an amount given, let's say that in the beginning, that
06:52amount is 590.
06:53I will do a loop. For int i equals 0 to i less than n.
06:59I will do every time plus plus. What is this loop? This coins or currency array.
07:05I will compare every time. I will compare every time that I am talking about coin of i.
07:10What is this value less than my amount? If value is less than amount, then it means that the change
07:17can be removed.
07:18So, I will remove this change. How will I remove this change?
07:21Every time, I will take a final variable. I will take a number of coins.
07:28I will take this account. I will change by Sek.
07:29Amount рдХреЛ рдХрд░ рджреВрдВрдЧреА plus plus рдорддрд▓рдм change рдореИрдВрдиреЗ single note
07:32рдпрд╛ single coin рдХреЛ add рдХрд░ рд▓рд┐рдпрд╛ рдЙрд╕рдХреЗ рдмрд╛рдж amount рдореЗрдВ
07:35рд╕реЗ deduct рдХрд░ рджреВрдВрдЧреА рд╕рдорд╛рдВрдЯ рдХреЛ amount is equal to amount
07:40minus coin of i рддреЛ рдореЗрд░реА amount рдХрдо рд╣реЛ рдЬрд╛рдПрдЧреА рдФрд░
07:45рдпрд╣ рдЬреЛ рдореЗрд░рд╛ рдХрд╛рдо рд╣реИ рдмрд╛рд░ рдмрд╛рд░ рдЙрд╕ coin рдХреЛ рдЙрдард╛рдХрд░
07:47рдЕрдкрдиреА amount рдХреЗ рдЕрдВрджрд░ add рдХрд░рдиреЗ рд╡рд╛рд▓ account рд╡рд╛рд▓рд╛ рдпрд╣ рдореИрдВ рддрдм
07:59amount рдореЗрд░реЗ coin of i рд╕реЗ рдмрдбрд╝реА рд╣реИ рддреЛ рдореИрдВ рддрдм рддрдХ loop
08:02рдЪрд▓рд╛рдКрдВрдЧреА рдЬрдм рддрдХ рдпрд╣ рдореЗрд░реА same amount
08:05рдореЗрд░реЗ coin of i рд╕реЗ рдмрдбрд╝реА рдирд╣реАрдВ рд░рд╣рддреА рддрдм
08:08рддрдХ рдореИрдВ рдЙрд╕ same coin рдХреЛ рдЙрдард╛ рджреА рд░рд╣реВрдВрдЧреА рдФрд░ рдЕрдкрдиреА amount
08:11рдХреЛ рдШрдЯрд╛рддреА рд░рд╣реВрдВрдЧреА рдЗрд╕ coin рдХреЛ рдореИрдВрдиреЗ рдкрд╣рд▓реЗ
08:14рдореБрдЭреЗ рджреЗрдиреЗ рдереЗ рддреЛ рдкрд╣рд▓реЗ рдореИрдВрдиреЗ рдПрдХ рдмрд╛рд░ 20 рдХреЛ рдЙрдард╛рдпрд╛
08:16рдлрд┐рд░ рдореЗрд░реЗ рдкрд╛рд╕ amount рд░рд╣ рдЧрдИ 20 рдХреЗ equal
08:19рдлрд┐рд░ рдореИрдВрдиреЗ рджреБрдмрд╛рд░рдм 20 рд╡рд╛рд▓реЗ note рдХреЛ рдЙрдард╛рдпрд╛
08:21рдлрд┐рд░ рдореЗрд░реЗ рдкрд╛рд╕ amount рд░рд╣ рдЧрдИ 0
08:22рдФрд░ рдЕрдм рдореБрдЭреЗ рджреБрдмрд╛рд░рдм 20 рдХреЛ рдЙрдард╛рдиреЗ рдХреА рдЬрд╝рд░рдд рдирд╣реАрдВ
08:25рддреЛ рдЕрдВрджрд░ рдПрдХ while loop рд▓рдЧреЗрдЧрд╛
08:26рдлрд┐рд░ рдореИрдВ if рдХреЛ close рдХрд░ рджреВрдБрдЧреА рдлрд┐рд░ рдореИрдВ for рдХреЛ
08:28close рдХрд░ рджреВрдБрдЧреА рдореЗрд░реЗ рдкрд╛рд╕ basically
08:30рдпрд╣ рдореЗрд░рд╛ code рд╣реЛрдЧрд╛ рдЬрд┐рд╕рдореЗрдВ
08:32рдореБрдЭреЗ рд╣рд░ рдмрд╛рд░ рдЕрдкрдиреЗ coins рд╕реЗ рдЬрд╛рдХрд░ рдкреВрдЫрдирд╛ рд╣реИ рдХрд┐
08:34рдХреНрдпрд╛ рдЙрд╕ coin рдХреЛ add рдХрд┐рдпрд╛ рдЬрд╛ рд╕рдХрддрд╛ рд╣реИ
08:36coin рдХреЛ add рдХрд░рдиреЗ рдХреА condition рдпрд╣ рд╣реЛрдЧреА
08:38рдХрд┐ рдЬрд┐рд╕ рднреА amount рдХреЛ рдореБрдЭреЗ pay рдХрд░рдирд╛ рд╣реИ
08:40рдХреНрдпрд╛ рдЙрд╕рдХреА value coin of i рд╕реЗ рдЬрд╛рджрд╛ рд╣реИ
08:42рдорддрд▓рдм рдЕрдЧрд░ рдореБрдЭреЗ 590 рдкреЗ рдХрд░рдирд╛ рд╣реИ
08:44рддреЛ рдХреНрдпрд╛ рд╡реЛ 500 рд╕реЗ рдмрдбрд╝рд╛ рд╣реИ
08:46рд╣рд╛рдБ рд╣реИ рддреЛ рдЙрд╕ case рдореЗрдВ рджреЗрдЦ рд▓реВрдБрдЧреА
08:48рдХрд┐рддрдиреЗ рдореБрдЭреЗ notes рдпрд╛ рдХрд┐рддрдиреЗ coins рдЪрд╛рд╣рд┐рдП
08:50рд╣реЛрдЧреЗ рдЬрдм рддрдХ amount greater than
08:52equal to coin of i рд░рд╣рддреА рд╣реИ рддрдм рддрдХ count рдХреЛ рдХрд░ рджреВрдБрдЧреА
08:54plus plus рдФрд░ amount рдХреЛ
08:56decrease рдХрд░ рджреВрдБрдЧреА by that coin value
08:58рддреЛ 590 рдореЗрдВ рд╕реЗ рдЕрдЧрд░ рдореИрдВрдиреЗ
09:00500 рдХреЛ decrease рдХрд░ рджрд┐рдпрд╛ рддреЛ рдореЗрд░реЗ рдкрд╛рд╕
09:0290 рд░рд╣ рдЬрд╛рдПрдЧрд╛ рдпрд╣рд╛рдБ рдкрд░
09:04amount рдЕрдм рдЬреЛ рдореБрдЭреЗ pay рдХрд░рдиреА рд╣реЛрдЧреА that will be
09:06equal to 90 рддреЛ рдХреБрдЫ рдЗрд╕ рддрд░реАрдХ рдХрд╛
09:08logic рд╣рдо apply рдХрд░реЗрдВрдЧреЗ рдЕрдкрдиреЗ Indian coins
09:10рд╡рд╛рд▓реА problem рдХреЛ solve рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП
09:12рдФрд░ рдпрд╛ рдореИрдВрдиреЗ greedy approach рдХреЛ рдХреИрд╕реЗ apply рдХрд┐рдпрд╛
09:14greedy approach рдХреЛ apply рдХрд░рдиреЗ рдХрд╛ рдорддрд▓рдм
09:16рд╣реИ рдХрд┐ maximum value рд╡рд╛рд▓реЗ coin
09:18рдХреЛ рдореИрдВрдиреЗ рдкрд╣рд▓реЗ рджреЗрдиреА рдХреА рдХреЛрд╢рд┐рд╢ рдХреА
09:20рдХрд┐ рдЕрдЧрд░ рдореБрдЭреЗ рдХрд┐рд╕реА рдХреЛ 2000 рд░реБрдкреЗ рджреЗрдиреЗ
09:22рд╣реИ рддреЛ рдпрд╛ рддреЛ рдореИрдВ 500 500 рдХреЗ
09:244 note рджреЗ рджреВрдБ рдпрд╛ рдореИрдВ 2000 рдХрд╛ single note рджреЗ рджреВрдБ
09:26greedy approach рдХреЗ according рдореИрдВ
09:282000 рдХрд╛ single note рд╣реА first time рдореЗрдВ
09:30рджреЗ рд░рд╣реА рд╣реЛрдВрдЧреА рдореИрдВ 500 500 рдХреЗ 4
09:32рдирд╣реАрдВ рджреЗ рд░рд╣реА рд╣реЛрдВрдЧреА
09:33рдЗрд╕рдХреЗ рд▓рд┐рдП рдЕрдм рдЖрдк рдПрдХ рдмрд╛рд░ code
09:35рд▓рд┐рдЦрдХрд░ рджреЗрдЦрддреЗ рд╣реИрдВ рдореИрдВрдиреЗ
09:36class рдмрдирд╛рдИ рд╣реИ рдЬрд┐рд╕рдХреЗ рдЕрдВрджрд░ main function рд╣реИ
09:38main function рдХреЗ рдЕрдВрджрд░ рдмрд╣реБрдд рд╕рд╛рд░реЗ
09:40coins рдбрд╛рд▓реЗ рд╣реВрдВ рдПрдХ single area рдХреЗ рдЕрдВрджрд░
09:42рд╕рдмрд╕реЗ рдкрд╣рд▓реЗ рдХрд╛рдо рдЬреЛ рдореИрдВ рдХрд░реВрдВрдЧреА рд╡реЛ рд╣реИ
09:44this area рдХреЛ descending order рдореЗрдВ sort рдХрд░рдирд╛
09:46descending order рдореЗрдВ sort рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП
09:48рдореЗрд░реА рдпрд╣ рдЬреЛ coins рд╣реИ рдпрд╣
09:49integer type рдХрд╛ рд╣реЛрдирд╛ рдЪрд╛рд╣рд┐рдП
09:51рддреЛ рдореИрдВ рдпрд╣ рд▓рд┐рдЦ рд╕рдХрддреЗ рд╣реВрдВ
09:52comparator.reverseOrder
09:55рддреЛ рдХреНрдпрд╛ рд╣реЛрдЧрд╛ рдореЗрд░реА рдЗрд╕ рд╕рд╛рд░реА рдХреА рд╕рд╛рд░реА
09:57values reverse order рдореЗрдВ рдореЗрд░реЗ рдкрд╛рд╕ sorted
09:59рд╣реЛрдХрд░ рдЖ рдЬрд╛рдПрдВрдЧреА рдЗрд╕рдХреЗ рд▓рд┐рдП
10:01integer class рдХреЗ objects
10:03рд╣реЛрдирд╛ рдЬрд░реВрд░реА рд╣реИ рдпрд╣рд╛рдВ рдкрд░ рдореБрдЭреЗ
10:05int рд╡рд╛рд▓рд╛ primitive type use рдирд╣реАрдВ рдХрд░рдирд╛ рд╣реИ рдирд╣реАрдВ
10:07рддреЛ рдореИрдВ рдЗрд╕ reverse order рдХреЛ call рдирд╣реАрдВ рдХрд░
10:19рдмрд╕ рдЗрддрдирд╛ рд╕рд╛ simple change рдореБрдЭреЗ рдХрд░рдирд╛ рдкрдбрд╝реЗрдЧрд╛
10:21рдЕрдм рдореИрдВ рдХреНрдпрд╛ рдХрд░реВрдВрдЧреА
10:23рд╕рдмрд╕реЗ рдкрд╣рд▓реЗ рддреЛ рд▓реЗ рд▓реЗрддреА рд╣реВрдВ
10:24рдЕрдкрдирд╛ count
10:26this is my count of coins
10:28рдЬрд┐рд╕рдХреЛ рдореИрдВ рд╢реБрд░реВ рдХрд░реВрдВрдЧреА 0 рдХреЗ рд╕рд╛рде
10:30рдЙрд╕рдХреЗ рдЕрд▓рд╛рд╡рд╛ рд▓реЗ рд▓реЗрддреА рд╣реВрдВ рдЕрдкрдиреА amount
10:32рдорд╛рди рд▓реЗрддреЗ рд╣реИрдВ рдореЗрд░реА рдЬреЛ amount рд╣реИ
10:33that is going to be 590
10:36рдЗрд╕рдХреЗ рдЕрд▓рд╛рд╡рд╛ рдЕрдкрдиреЗ array list рдореЗрдВ
10:49is equal to 0 рд╕реЗ рдЬрд╛рдПрдЧрд╛ i less than coins dot length рд╕рдХ
10:53i рдХреЛ рдХрд░ рджреВрдВрдЧреА plus plus
10:55рд╣рд░ рдмрд╛рд░ рдореБрдЭреЗ check рдХрд░рдирд╛ рд╣реИ рдХрд┐ рдЬреЛ amount рдореИрдВ
10:57pay рдХрд░рдирд╛ рдЪрд╛рд╣рддреА рд╣реВрдВ рдХреНрдпрд╛ рд╡реЛ amount рдмрдбрд╝реА рд╣реИ
10:59рдореЗрд░реЗ coins of i рд╕реЗ рддрднреА coins рдХреЛ use
11:01рдХрд░ рд╕рдХрддреА рд╣реВрдВ рддреЛ if coins
11:03of i
11:05is less than my amount
11:08рдпрд╛ рдлрд┐рд░
11:09рдпрд╣рд╛рдБ рдкрд░ less than equal
11:11to рддрднреА рдореИрдВ рдХреНрдпрд╛ рдХрд░ рдкрд╛рдКрдВрдЧреА
11:13рддрдм рдПрдХ loop рдЪрд▓рд╛рдКрдВрдЧреА рджреЗрдЦрдиреЗ рдХреЗ рд▓рд┐рдП рдХрд┐
11:14рдХрд┐рддрдиреЗ coins рдореБрдЭреЗ use рдХрд░рдиреЗ рд╣реИ
11:16coins of i рдЬрдм рддрдХ less than equal to amount
11:19рд░рд╣реЗ рддрдм рддрдХ
11:21рд╣рд░ рдмрд╛рд░ count рдХреЛ рдХрд░ рджреЗрдВрдЧреЗ plus plus
11:22рдпрд╛ рдлрд┐рд░ рдЗрд╕рдХреЛ рдореИрдВ рдХрд╣ рджреВрдВ count of
11:25coins рдХреЛ рдХрд░ рджреЗрдВрдЧреЗ plus plus
11:27answer рдореЗрдВ рдореИрдВ add рдХрд░ рджреВрдВрдЧреА рдЕрдкрдирд╛ coins of i
11:29and amount рдХреЛ decrease
11:31рдХрд░ рджреВрдВрдЧреА by
11:33coins of i
11:34рдпрд╛рдирд┐ amount decrease рд╣реЛрддреА рдЬрд╛рдПрдЧреА
11:37рдЬреИрд╕реЗ рдЬреИрд╕реЗ рдореИрдВрдиреЗ pay рдХрд░ рджрд┐рдпрд╛ рдЖрдк
11:38pay рдХрд░рдиреЗ рд╡рд╛рд▓реА amount рднреА decrease рд╣реЛрдЧреА рдФрд░ рд╣рд░ рдмрд╛рд░ count рдХреЛ
11:40рдХрд░ рджреВрдВрдЧреА increase
11:42рдЗрддрдирд╛ рдореЗрд░реЗ рдкрд╛рд╕ рдпрд╣ loop рдЪрд▓реЗрдЧрд╛ рдЬрд┐рд╕рдореЗрдВ
11:44рдореИрдВ рдЕрдкрдиреЗ coins рдХреЛ find out рдХрд░ рд░рд╣реА рд╣реЛрдВрдЧреА
11:46last рдореЗрдВ рдХреНрдпрд╛ рдХрд░реВрдВрдЧреА print рдХрд░ рджреВрдВрдЧреА
11:48total minimum
11:52coins used
11:52is equal to this
11:54will be my count of coins
11:56рдЙрд╕рдХреЗ рдмрд╛рдж рдЬреЛ use рд╣реБрдП рд╣реИ рдЙрдирдХреЛ
11:58рдореИрдВ print рднреА рдХрд░рд╡рд╛ рд╕рдХрддреА рд╣реВрдВ
11:59рдЬреЛ рднреА coins and notes use рд╣реБрдП рд╣реИ
12:01i is equal to 0 рд╕реЗ рд▓реЗрдХрд░ answer.size
12:04рддрдХ loop рдЪрд▓рд╛ рджреВрдВрдЧреА
12:05i++
12:07рд╣рд░ рдмрд╛рд░ рдХреНрдпрд╛ рдХрд░реВрдВрдЧреА
12:08print рдореИрдВ рдХрд░рд╡рд╛ рджреВрдВрдЧреА
12:09my answer.get i рдХреЛ
12:12рдЗрд╕рдХреЛ рдХрд░рддреЗ рд╣реИ safe
12:13рдПрдХ рдмрд╛рд░ рдореИрдВ summarize рднреА рдХрд░ рджреЗрддреА рд╣реВрдВ
12:15рдпрд╣ рдореЗрд░реЗ рдкрд╛рд╕ рд╢реБрд░реБрд╡рд╛рдд рдореЗрдВ рдХреБрдЫ coins рдереЗ
12:17рд╕рд╛рд░реЗ рдХреЗ рд╕рд╛рд░реЗ coins and notes рдХреЛ рдореИрдВрдиреЗ
12:19reverse order рдореЗрдВ
12:20descending order рдореЗрдВ sort рдХрд░ рджрд┐рдпрд╛ рд╣реИ
12:22рдЙрд╕рдХреЗ рдмрд╛рдж рдореИрдВрдиреЗ count рд▓реЗ рд▓рд┐рдпрд╛ рд╣реИ
12:24coins рдХрд╛, amount рд▓реЗ рд▓рд┐рдпрд╛ рд╣реИ
12:25рдЬрд┐рд╕рдХреЗ рд╕рд╛рде рд╢реБрд░реБрд╡рд╛рдд рдХреА
12:26and рдПрдХ answer array list рд▓реЗ рд▓рд┐рдпрд╛ рд╣реИ
12:28рдореИрдВрдиреЗ рд╣рд░ рдмрд╛рд░ check рдХрд┐рдпрд╛
12:29рдХреНрдпрд╛ рдЬрд┐рд╕ amount рдХреЛ рдореБрдЭреЗ pay рдХрд░рдирд╛ рд╣реИ
12:31рд╡реЛ greater than рдпрд╛ equal to рд╣реИ
12:33рдореЗрд░реЗ coins рд╕реЗ
12:33рдЕрдЧрд░ рд╣реИ
12:34рддреЛ рдлрд┐рд░ рдПрдХ while loop рдЪрд▓рд╛ рдХрд░ рджреЗрдЦ рд▓реВрдБ
12:36рдХрд┐рддрдиреЗ coins рдпреВрдЬ рдХрд░рдиреЗ рдкрдбрд╝реЗрдВрдЧреЗ
12:37рдорддрд▓рдм 20 рдХрд╛ рдЕрдЧрд░ note рдпреВрдЬ рдХрд░рдирд╛ рд╣реИ
12:39рддреЛ рдХрд┐рддрдиреА рдмрд╛рд░ рдпреВрдЬ рдХрд░рдирд╛ рд╣реИ
12:40рдЬрдм рддрдХ рдореЗрд░реА amount greater than
12:42equal to coins of i рдирд╣реАрдВ рд░рд╣рддреА
12:44рддреЛ рдореИрдВ рд╣рд░ рдмрд╛рд░ count рдХреЛ рдХрд░ рджреВрдБрдЧреА
12:46plus plus answer рдореИрдВ add рдХрд░ рджреВрдБрдЧреА
12:47coins of i and amount рдХреЛ decrease рдХрд░ рджреВрдБрдЧреА
12:49by coins of i
12:50last рдореИрдВ рдЕрдкрдирд╛ count рднреА рдореИрдВ print рдХрд░ рджреВрдБрдЧреА
12:52рдФрд░ рдореИрдВ рдЕрдкрдиреЗ array list рдХреЛ рдХрд░ рджреВрдБрдЧреА
12:55рд╕рд╛рд░реЗ notes рдХреЛ and coins рдХреЛ print
12:57рдЗрд╕рдХреЗ рд▓рд┐рдП run рдХрд░рддреЗ рд╣реИ code рдХреЛ
12:59рддреЛ 590 рдХреЗ рд▓рд┐рдП answer рдЖрдпрд╛ рд╣реИ
13:02рдХрд┐ рдореИрдВ 4 total coins рдХреЛ use рдХрд░ рд░рд╣реА рд╣реВрдБрдЧреА
13:051500 рдХрд╛ note рд▓реВрдБрдЧреА
13:06150 рдХрд╛ note рд▓реВрдБрдЧреА
13:072 рдореЗрдВ 20-20 рдХреЗ note рд▓реВрдБрдЧреА
13:09рдЗрд╕ amount рдХреЛ рдореИрдВ change рднреА рдХрд░ рд╕рдХрддреА рд╣реВрдБ
13:11рдЗрд╕рдХреЛ рдорд╛рди рд▓реЗрддреЗ рд╣реИрдВ рдореИрдВрдиреЗ рдХрд░ рджрд┐рдпрд╛
13:131050 рдХреЗ рдмрд░рд╛рдмрд░
13:151059
13:16рддреЛ 1059 рдХрд┐рд╕реА рдХреЛ pay рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП
13:19рдореИрдВ рдХреНрдпрд╛ рдХрд░реВрдБрдЧреА 500 500 рдХреЗ рдореИрдВ 2 notes рд▓реВрдБрдЧреА
13:22рдлрд┐рд░ 50 рдХрд╛ note рд▓реВрдБрдЧреА
13:23рдлрд┐рд░ 5 рд░реБрдкреЗ рдХрд╛ рдПрдХ рд╕рд┐рдХреНрдХрд╛ рд▓реВрдБрдЧреА
13:25рдлрд┐рд░ 2-2 рд░реБрдкреЗ рдХреЗ 2 рд╕рд┐рдХреНрдХреЗ рд▓реВрдБрдЧреА
13:28рддреЛ рдЗрд╕ рддрд░реАрдХреЗ рд╕реЗ 1059
13:30рд╡рд╛рд▓реА total рдЬреЛ amount рд╣реИ рдЙрд╕рдХреЛ
13:31рдореИрдВ рдХрд┐рд╕реА рдХреЛ рднреА pay рдХрд░ рд╕рдХрддреА рд╣реВрдБ
13:33рддреЛ рдЗрд╕ рддрд░реАрдХреЗ рд╕реЗ Indian coin change рд╡рд╛рд▓реА
13:35problem рдХреЛ рд╣рдо solve рдХрд░рддреЗ рд╣реИрдВ