From 1173aef94c7fb0e78a668223448cdde42d217a7b Mon Sep 17 00:00:00 2001 From: oheunhyuck <71165142+oheunhyuck@users.noreply.github.com> Date: Thu, 12 Nov 2026 22:48:02 +0900 Subject: [PATCH 1/2] Create 988. Smallest String Starting From Leaf --- .../988. Smallest String Starting From Leaf" | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 "leetcode3/\354\230\244\354\235\200\355\230\201/988. Smallest String Starting From Leaf" diff --git "a/leetcode3/\354\230\244\354\235\200\355\230\201/988. Smallest String Starting From Leaf" "b/leetcode3/\354\230\244\354\235\200\355\230\201/988. Smallest String Starting From Leaf" new file mode 100644 index 00000000..a45a9a4d --- /dev/null +++ "b/leetcode3/\354\230\244\354\235\200\355\230\201/988. Smallest String Starting From Leaf" @@ -0,0 +1,37 @@ +# Definition for a binary tree node. +# class TreeNode: +# def __init__(self, val=0, left=None, right=None): +# self.val = val +# self.left = left +# self.right = right + + +class Solution: + + def dfs(self,node,trace): + trace.append(node.val) + if node.left != None:self.dfs(node.left,trace) + if node.right != None:self.dfs(node.right,trace) + + + if node.left ==None and node.right==None: + s="" + + for i in range(len(trace)-1,-1,-1): + s+=chr(97+trace[i]) + + self.ans.append(s) + trace.pop() + + + + + + + + def smallestFromLeaf(self, root: TreeNode | None) -> str: + + self.ans=[] + self.dfs(root,[]) + + return sorted(self.ans)[0] From a2780e2910195eba85cc8c90c235ba0af12fd317 Mon Sep 17 00:00:00 2001 From: oheunhyuck <71165142+oheunhyuck@users.noreply.github.com> Date: Thu, 12 Nov 2026 22:48:37 +0900 Subject: [PATCH 2/2] Create 2305. Fair Distribution of Cookies --- .../2305. Fair Distribution of Cookies" | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 "leetcode3/\354\230\244\354\235\200\355\230\201/2305. Fair Distribution of Cookies" diff --git "a/leetcode3/\354\230\244\354\235\200\355\230\201/2305. Fair Distribution of Cookies" "b/leetcode3/\354\230\244\354\235\200\355\230\201/2305. Fair Distribution of Cookies" new file mode 100644 index 00000000..7e9627a7 --- /dev/null +++ "b/leetcode3/\354\230\244\354\235\200\355\230\201/2305. Fair Distribution of Cookies" @@ -0,0 +1,16 @@ +from itertools import combinations +from collections import Counter + +class Solution: + def c(self,cookie): + for i in range(1,len(cookie)): + + for s in combinations(cookie,i): + temp.append(sum(s)) + + + def distributeCookies(self, cookies: list[int], k: int) -> int: + + + +