Google, Microsoft & Amazon love this Dynamic Programming Problem - Coin Change: Leetcode 322

preview_player
Показать описание
#Dynamic #Programming #Java #Leetcode #Important #Concept #Learning

Learning Dynamic programming problems from Leetcode, with Java coding solution, optimal solution, time and space complexity analysis, understanding the problem, getting brute force approach, and the arriving to optimal solution.

Leetcode Medium: Dynamic Programming, Very Important, Concept and understanding.

Not stopping till we get employed in FAANG.
------------------------------------------------------------------------------------------------------------------------------------------------
(Contact me if you want to sponsor your product):

List of Most Important Questions and Solutions:

GitHub Repository for Questions solved so far:

(Support the channel, if videos helps you in any manner... Give me a Coffee)

About me and My Purpose:

I am a software engineer with 5+ years of experience @ Non-FAANG company. I have always been bad at coding and really bad at programming interviews. So, once I got employed in IT industry, I worked on operations (just so I can avoid coding).

But deep down I always wanted to work at an Elite IT company. So, I decided to face my fears, and to master coding & technical Interviews. I started with LeetCoding 1 problem a day. But I was facing issues with consistency, I would solve LC problems for week, and then drop it for 2-3 weeks. This lasted till 6 months.

And upon deeper investigation I found that I was not committed enought. Then suddenly my wife gave me an idea, that rather then focusing on solving a LC problem for my-self, why don't I commit to make videos on solving the LC problems. And try to complete atleast one video a day. Hence, I started this channel.

Here are reasons on why I started the channel.

1) To have a motive for me to solve leetcode problems.
2) In order to solve a LC problem, first I have to really understand the problem and explain my thought process, which solidifies my concepts.
3) I can document my progress. Also learn a new skill on how to run a YT channel.
4) My work can help other software engineers.
5) I can have something cool to mention in my linked-in and resume.

---------------------------------------------------------------------------------------------------------------------------------

Problem asked recently in following companies in coding interview:
Microsoft interview,
Amazon interview,
Google interview,
Mathworks interview,
Walmart Global Tech interview,
Apple interview,
Facebook interview,
Bloomberg interview,
Yahoo interview,
Paypal interview,
tiktok interview,

My dream IT companies:

FAANG,
Facebook,
Google,
Amazon,
Netflix,
Microsoft,
apple,
doordash,
roblox,
stripe,
instacart,
uber,
lyft,
twitter,
linked In,
pinetrest,
bloomberg,
robinhood,
box,
two sigma,
byte dance,
tik tok,
air bnb,
nuro,
ui path,
oracle,
twitch,
data bricks,
waymo,
dropbox,
coinbase,
snowflake,
snap,
nvdia,
broadcom,
slack,
intel,
cisco,
indeed,
salesforce,
reddit,
wayfair,
okta,
splunk,
service now,
coursera,
square,
upgrade,
mozilla,
yelp,
unity,
ebay,
affirm,
stach adapt,
amplitude,
github,
wish,
brex,
etsy,
chime,
shopify,
amd,
GoDaddy,
IBM,

Understanding the Problem: 00:00
Greedy and Brute Force Approach: 02:02
Optimal Solution: 12:00
Coding: 26:37
Рекомендации по теме
Комментарии
Автор

Java Solution

class Solution {
public int coinChange(int[] coins, int amount) {

int amt[] = new int[amount+1];

Arrays.fill(amt, amount+1);

amt[0] = 0;

for(int i=1; i<=amount; i++){
for(int j=0; j<coins.length; j++){
if(i >= coins[j]){
amt[i] = Math.min(amt[i], 1+amt[i-coins[j]]);
}
}
}

if(amt[amount] < amount+1){
return amt[amount];
}
return -1;

}
}

DestinationFAANG
Автор

25th min is not understood..it is very difficult

ssnprakash