From 0fa507eb0e79ba817391f4ec86eb63a308e5719d Mon Sep 17 00:00:00 2001 From: zzu <90972641+Zuhye@users.noreply.github.com> Date: Thu, 19 Nov 2026 22:50:35 +0900 Subject: [PATCH 1/2] 1828. Queries on Number of Points Inside a Circle Implement method to count points inside circles based on queries. --- .... Queries on Number of Points Inside a Circle" | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 "leetcode3/\354\206\241\354\243\274\355\230\234/1828. Queries on Number of Points Inside a Circle" diff --git "a/leetcode3/\354\206\241\354\243\274\355\230\234/1828. Queries on Number of Points Inside a Circle" "b/leetcode3/\354\206\241\354\243\274\355\230\234/1828. Queries on Number of Points Inside a Circle" new file mode 100644 index 00000000..b1b4cc6a --- /dev/null +++ "b/leetcode3/\354\206\241\354\243\274\355\230\234/1828. Queries on Number of Points Inside a Circle" @@ -0,0 +1,15 @@ +class Solution: + def countPoints(self, points: list[list[int]], queries: list[list[int]]) -> list[int]: + result = [] + + for x, y, r in queries: + cnt = 0 + + for i, j in points: + if (i-x)**2 + (j-y)**2 <= r**2: + cnt +=1 + + result.append(cnt) + return result + + ## 시간복잡도: O(n^2) From 029fea420a54225618f40a17afefe393f58c2891 Mon Sep 17 00:00:00 2001 From: zzu <90972641+Zuhye@users.noreply.github.com> Date: Thu, 19 Nov 2026 22:51:05 +0900 Subject: [PATCH 2/2] 1802. Maximum Value at a Given Index in a Bounded Array Implement maxValue function to calculate maximum value at a given index in a bounded array. --- ...Value at a Given Index in a Bounded Array" | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 "leetcode3/\354\206\241\354\243\274\355\230\234/1802. Maximum Value at a Given Index in a Bounded Array" diff --git "a/leetcode3/\354\206\241\354\243\274\355\230\234/1802. Maximum Value at a Given Index in a Bounded Array" "b/leetcode3/\354\206\241\354\243\274\355\230\234/1802. Maximum Value at a Given Index in a Bounded Array" new file mode 100644 index 00000000..aba09de3 --- /dev/null +++ "b/leetcode3/\354\206\241\354\243\274\355\230\234/1802. Maximum Value at a Given Index in a Bounded Array" @@ -0,0 +1,20 @@ +class Solution: + def maxValue(self, n: int, index: int, maxSum: int) -> int: + numbers = [1] * n + tmp = maxSum - n # 남은거 + left = index + right = index + + while True: + value = right - left + 1 # 개수 + if tmp < value: + break + + for i in range(left, right + 1): + numbers[i] += 1 + tmp -= value + + print(tmp, value) + + +