From 9f530a916fe36f6812f83e4386bc936e53849298 Mon Sep 17 00:00:00 2001 From: Won Joon Thomas Choi <113500771+724thomas@users.noreply.github.com> Date: Tue, 22 Sep 2026 22:27:04 +0900 Subject: [PATCH 1/2] Create 860. Lemonade Change.py --- .../860. Lemonade Change.py" | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 "leetcode3/\354\265\234\354\233\220\354\244\200/860. Lemonade Change.py" diff --git "a/leetcode3/\354\265\234\354\233\220\354\244\200/860. Lemonade Change.py" "b/leetcode3/\354\265\234\354\233\220\354\244\200/860. Lemonade Change.py" new file mode 100644 index 00000000..5f32513d --- /dev/null +++ "b/leetcode3/\354\265\234\354\233\220\354\244\200/860. Lemonade Change.py" @@ -0,0 +1,44 @@ +# + +''' +1. 아이디어 : +- + +2. 시간복잡도 : + O(n) + +3. 자료구조/알고리즘 : +dict + +''' +class Solution: + def lemonadeChange(self, bills: list[int]) -> bool: + count = {5:0, 10:0, 20:0} #5, 10, 20 + + def is_possible(payment): + if payment == 20: + if count[10] >= 1 and count[5] >= 1: + count[10] -= 1 + count[5] -= 1 + count[20] += 1 + return True + elif count[10] == 0 and count[5] >= 3: + count[5] -= 3 + count[20] += 1 + return True + elif payment == 10: + if count[5] >= 1: + count[5] -= 1 + count[10] += 1 + return True + elif payment == 5: + count[5] += 1 + return True + + return False + + for b in bills: + if not is_possible(b): + return False + return True + From 7b72c4fb8015729b5a7516f7091276f41e592334 Mon Sep 17 00:00:00 2001 From: Won Joon Thomas Choi <113500771+724thomas@users.noreply.github.com> Date: Tue, 22 Sep 2026 22:28:02 +0900 Subject: [PATCH 2/2] Create 835. Image Overlap.py --- .../835. Image Overlap.py" | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 "leetcode3/\354\265\234\354\233\220\354\244\200/835. Image Overlap.py" diff --git "a/leetcode3/\354\265\234\354\233\220\354\244\200/835. Image Overlap.py" "b/leetcode3/\354\265\234\354\233\220\354\244\200/835. Image Overlap.py" new file mode 100644 index 00000000..ee74c4bd --- /dev/null +++ "b/leetcode3/\354\265\234\354\233\220\354\244\200/835. Image Overlap.py" @@ -0,0 +1,42 @@ +# + +''' +1. 아이디어 : +한칸씩 옮긴다음 계산한다. + +2. 시간복잡도 : + O(n**4) + +3. 자료구조/알고리즘 : +- + +''' +class Solution: + def largestOverlap(self, img1: list[list[int]], img2: list[list[int]]) -> int: + n = len(img1) + + def get_count(offset_x, offset_y): + count = 0 + + for x in range(n): + for y in range(n): + mx = x + offset_x + my = y + offset_y + if 0<=mx