Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions leetcode3/황은지/835. Image Overlap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* @param {number[][]} img1
* @param {number[][]} img2
* @return {number}
*/
var largestOverlap = function (img1, img2) {
// 상하좌우로 움직일수있고,
// 최대한 많이 겹칠때 1의 갯수를 구하라?
// 9*9매트리스로 그릴려했으나, 움직이는 방향이 중간에 바뀌면 커버가 불가하다.
};
31 changes: 31 additions & 0 deletions leetcode3/황은지/860. Lemonade Change.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* @param {number[]} bills
* @return {boolean}
*/
var lemonadeChange = function (bills) {
const billCount = Array(5).fill(0);

for (const bill of bills) {
let change = bill - 5;
if (change !== 0) {
for (let i = 4; i >= 0; i--) {
if (billCount[i] === 0) continue;
const curBil = i * 5;
while (billCount[i] * curBil >= change) {}
if (curBil >= change) {
const total = curBil * billCount[i];
if (total >= change) change === 0;
else {
change -= billCount[i] * curBil;
billCount[i] = 0;
}
}
if (change === 0) break;
}
if (change > 0) return false;
}
billCount[bill / 5]++;
console.log(billCount);
}
return true;
};
Loading