From 7723c0dc2de708deaefbacd684c21b8402d1eafd Mon Sep 17 00:00:00 2001 From: 12novel30 <79260472+12novel30@users.noreply.github.com> Date: Thu, 26 Jan 2023 21:45:27 +0900 Subject: [PATCH 01/13] =?UTF-8?q?Refactoring:=20=EC=A4=91=EB=B3=B5?= =?UTF-8?q?=EB=90=9C=20=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ggangchongs/Angora/FromRestaurant/Greedy/1339.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/ggangchongs/Angora/FromRestaurant/Greedy/1339.py b/ggangchongs/Angora/FromRestaurant/Greedy/1339.py index 9f55298..7763a28 100644 --- a/ggangchongs/Angora/FromRestaurant/Greedy/1339.py +++ b/ggangchongs/Angora/FromRestaurant/Greedy/1339.py @@ -1,17 +1,13 @@ n = int(input()) -voca = [] alpha = {} for i in range(n): - tmp = list(input()) - for t in tmp: - alpha[t] = 0 - voca.append(tmp) - -for v in voca: - length = len(v) + voca = list(input()) + length = len(voca) for i in range(length): - oldValue = alpha[v[i]] - alpha[v[i]] += 10**(length-(i+1)) + if voca[i] not in alpha: + alpha[voca[i]] = 10**(length-(i+1)) + else: + alpha[voca[i]] += 10**(length-(i+1)) sorted_alpha = sorted(alpha.items(), key = lambda item: -item[1]) start = 9 From acc3498cebcc01271c6a242f48a7af5d90218bab Mon Sep 17 00:00:00 2001 From: 12novel30 <79260472+12novel30@users.noreply.github.com> Date: Wed, 1 Feb 2023 18:52:33 +0900 Subject: [PATCH 02/13] Refactor --- ggangchongs/Angora/FromRestaurant/DP/11055.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ggangchongs/Angora/FromRestaurant/DP/11055.py b/ggangchongs/Angora/FromRestaurant/DP/11055.py index 6a67e7f..17a4f06 100644 --- a/ggangchongs/Angora/FromRestaurant/DP/11055.py +++ b/ggangchongs/Angora/FromRestaurant/DP/11055.py @@ -4,7 +4,7 @@ sequence = list(map(int, sys.stdin.readline().split())) dp = [0]*n -dp[0], maxSum = sequence[0], sequence[0] +dp[0] = sequence[0] for i in range(1,n): for j in range(i): @@ -12,6 +12,5 @@ dp[i] = max(dp[i], dp[j] + sequence[i]) else: dp[i] = max(dp[i], sequence[i]) - maxSum = max(maxSum, dp[i]) -print(maxSum) +print(max(dp)) From b67abaa274fcd3be0df74235f78236636cd7d47b Mon Sep 17 00:00:00 2001 From: 12novel30 <79260472+12novel30@users.noreply.github.com> Date: Wed, 1 Feb 2023 18:52:57 +0900 Subject: [PATCH 03/13] =?UTF-8?q?Day:=2023-02-01=20Wed,=20Sort,=20?= =?UTF-8?q?=EC=9C=84=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Angora/7days/Hash/Feb_1st_Camouflage.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 ggangchongs/Angora/7days/Hash/Feb_1st_Camouflage.py diff --git a/ggangchongs/Angora/7days/Hash/Feb_1st_Camouflage.py b/ggangchongs/Angora/7days/Hash/Feb_1st_Camouflage.py new file mode 100644 index 0000000..84c47d5 --- /dev/null +++ b/ggangchongs/Angora/7days/Hash/Feb_1st_Camouflage.py @@ -0,0 +1,17 @@ +def solution(clothes): + + type = {} + for cloth in clothes: + answer = 1 + if cloth[1] not in type: + type[cloth[1]] = 1 + else: + type[cloth[1]] += 1 + + for c in type.values(): + answer *= c+1 + return answer-1 + + +clothes = [["yellow_hat", "headgear"], ["blue_sunglasses", "eyewear"], ["green_turban", "headgear"]] +print(solution(clothes)) \ No newline at end of file From c2c9dfe5e9fcbe607ebbddf5ece8b73b8b811271 Mon Sep 17 00:00:00 2001 From: 12novel30 <79260472+12novel30@users.noreply.github.com> Date: Thu, 2 Feb 2023 19:30:29 +0900 Subject: [PATCH 04/13] =?UTF-8?q?Day:=2023-02-02=20Thu,=20Stack&Queue,=20?= =?UTF-8?q?=ED=94=84=EB=A6=B0=ED=84=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../7days/Stack&Queue/Feb_1st_Printer.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ggangchongs/Angora/7days/Stack&Queue/Feb_1st_Printer.py diff --git a/ggangchongs/Angora/7days/Stack&Queue/Feb_1st_Printer.py b/ggangchongs/Angora/7days/Stack&Queue/Feb_1st_Printer.py new file mode 100644 index 0000000..738448e --- /dev/null +++ b/ggangchongs/Angora/7days/Stack&Queue/Feb_1st_Printer.py @@ -0,0 +1,24 @@ +def solution(priorities, location): + answer = 0 + + while len(priorities) != 0: + tmp = priorities.pop(0) + + if len(priorities) == 0: + return answer + 1 + + if tmp < max(priorities): # 출력 불가 + priorities.append(tmp) + if location == 0: location = len(priorities)-1 + else: location -= 1 + else: # 출력 가능 + answer += 1 + if location == 0: return answer + else: location -= 1 + +priorities = [1, 1, 2, 3, 2, 1] +location = 0 +print(solution(priorities, location)) + + +tmp = [] \ No newline at end of file From 0b418cd5d4ce234ccb87f5098aa514272d0b72ad Mon Sep 17 00:00:00 2001 From: 12novel30 <79260472+12novel30@users.noreply.github.com> Date: Fri, 3 Feb 2023 14:13:13 +0900 Subject: [PATCH 05/13] =?UTF-8?q?Day:=2023-02-03=20Fri,=20Brute-Force,=20?= =?UTF-8?q?=EC=B9=B4=ED=8E=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ggangchongs/Angora/7days/Brute-Force/Feb_1st_Carpet.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 ggangchongs/Angora/7days/Brute-Force/Feb_1st_Carpet.py diff --git a/ggangchongs/Angora/7days/Brute-Force/Feb_1st_Carpet.py b/ggangchongs/Angora/7days/Brute-Force/Feb_1st_Carpet.py new file mode 100644 index 0000000..9f153ef --- /dev/null +++ b/ggangchongs/Angora/7days/Brute-Force/Feb_1st_Carpet.py @@ -0,0 +1,6 @@ +def solution(brown, yellow): + + brown = (brown-4)/2 + for i in range(1, int(brown**1/2)+1): + if i*(brown-i) == yellow: + return [brown-i+2, i+2] \ No newline at end of file From a99259d72ef9e14b60d2e869d2402bdbaa392ad2 Mon Sep 17 00:00:00 2001 From: 12novel30 <79260472+12novel30@users.noreply.github.com> Date: Mon, 6 Feb 2023 16:44:43 +0900 Subject: [PATCH 06/13] Soup / Bread: [DS] --- .../FromRestaurant/dataStructure_tmp/11866.py | 24 +++++++++++++++++++ .../FromRestaurant/dataStructure_tmp/27160.py | 15 ++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 ggangchongs/Angora/FromRestaurant/dataStructure_tmp/11866.py create mode 100644 ggangchongs/Angora/FromRestaurant/dataStructure_tmp/27160.py diff --git a/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/11866.py b/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/11866.py new file mode 100644 index 0000000..1d9e60d --- /dev/null +++ b/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/11866.py @@ -0,0 +1,24 @@ +import sys + +n, k = map(int, sys.stdin.readline().split()) + +queue = [] +for i in range(n): + queue.append(i+1) + +count = 1 +answer = [] +while len(queue) != 0: + if count != k: + tmp = queue.pop(0) + queue.append(tmp) + count += 1 + else: + answer.append(queue.pop(0)) + count = 1 + +print("<", end='') +for i,a in enumerate(answer): + if i == len(answer)-1: print(a, end='') + else: print(a, end=', ') +print(">", end='') \ No newline at end of file diff --git a/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/27160.py b/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/27160.py new file mode 100644 index 0000000..ff26639 --- /dev/null +++ b/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/27160.py @@ -0,0 +1,15 @@ +import sys + +n = int(sys.stdin.readline()) + +fruits = {} +for i in range(n): + tmp, num = sys.stdin.readline().split() + if tmp in fruits: + fruits[tmp] += int(num) + else: + fruits[tmp] = int(num) + +if 5 in fruits.values(): print("YES") +else: print("NO") + \ No newline at end of file From 0d76d24ab3671fc7e5a3bbf7a3f0f969bf627a1f Mon Sep 17 00:00:00 2001 From: 12novel30 <79260472+12novel30@users.noreply.github.com> Date: Mon, 6 Feb 2023 16:45:09 +0900 Subject: [PATCH 07/13] Salad: [DS] --- .../FromRestaurant/dataStructure_tmp/1764.py | 13 +++++++++++++ .../FromRestaurant/dataStructure_tmp/9012.py | 17 +++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 ggangchongs/Angora/FromRestaurant/dataStructure_tmp/1764.py create mode 100644 ggangchongs/Angora/FromRestaurant/dataStructure_tmp/9012.py diff --git a/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/1764.py b/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/1764.py new file mode 100644 index 0000000..5a98f65 --- /dev/null +++ b/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/1764.py @@ -0,0 +1,13 @@ +import sys + +n, m = map(int, sys.stdin.readline().split()) + +d = [] +for i in range(n): d.append(sys.stdin.readline()) +b = [] +for i in range(m): b.append(sys.stdin.readline()) + +db = sorted(list(set(d)&set(b))) +print(len(db)) +for name in db: + print(name, end='') \ No newline at end of file diff --git a/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/9012.py b/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/9012.py new file mode 100644 index 0000000..1fa9a01 --- /dev/null +++ b/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/9012.py @@ -0,0 +1,17 @@ +import sys + +t = int(sys.stdin.readline()) + +testStack = [] +answer = "YES" +for i in range(t): + tmpPS = list(sys.stdin.readline()) + + for p in tmpPS: + if p == '(': testStack.append(p) + if p == ')': + if testStack[-1:] == ['(']: testStack.pop() + else: answer = "NO"; break + if len(testStack) != 0: answer = "NO" + print(answer) + testStack.clear(); answer ="YES" From cf470faad5704fb543726f300e72d2163c1e8232 Mon Sep 17 00:00:00 2001 From: 12novel30 <79260472+12novel30@users.noreply.github.com> Date: Mon, 6 Feb 2023 16:46:01 +0900 Subject: [PATCH 08/13] Main dish: [DS] --- .../FromRestaurant/dataStructure_tmp/1874.py | 31 +++++++++++++++++++ .../FromRestaurant/dataStructure_tmp/2493.py | 18 +++++++++++ .../FromRestaurant/dataStructure_tmp/2841.py | 30 ++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 ggangchongs/Angora/FromRestaurant/dataStructure_tmp/1874.py create mode 100644 ggangchongs/Angora/FromRestaurant/dataStructure_tmp/2493.py create mode 100644 ggangchongs/Angora/FromRestaurant/dataStructure_tmp/2841.py diff --git a/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/1874.py b/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/1874.py new file mode 100644 index 0000000..30db132 --- /dev/null +++ b/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/1874.py @@ -0,0 +1,31 @@ +''' +1 2 3 4 -> 4 +1 2 3 -> 4 +1 2 -> 4 3 +1 2 5 6 -> 4 3 +1 2 5 -> 4 3 6 +1 2 5 7 8 -> 4 3 6 + -> 4 3 6 8 7 5 2 1 +''' + +import sys + +n = int(sys.stdin.readline()) + +candi = 1 +stack, answer = [], [] +correct = True +for i in range(n): + target = int(sys.stdin.readline()) + while candi <= target: + stack.append(candi) + answer.append("+") + candi += 1 + if stack[-1] == target: + stack.pop() + answer.append("-") + else: correct = False; break + +if correct == False: print("NO") +else: + for a in answer: print(a) diff --git a/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/2493.py b/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/2493.py new file mode 100644 index 0000000..d626dd4 --- /dev/null +++ b/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/2493.py @@ -0,0 +1,18 @@ +import sys + +n = int(sys.stdin.readline()) +topList = list(map(int, sys.stdin.readline().split())) + +indexStack, answer = [1],[0] +for i, top in enumerate(topList): + if i == 0: continue + else: + + while topList[indexStack[-1]-1] < top: + indexStack.pop() + if len(indexStack) == 0: break + if len(indexStack) == 0: answer.append(0) + else: answer.append(indexStack[-1]) + indexStack.append(i+1) + +for i in answer: print(i, end=' ') \ No newline at end of file diff --git a/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/2841.py b/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/2841.py new file mode 100644 index 0000000..f94affd --- /dev/null +++ b/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/2841.py @@ -0,0 +1,30 @@ +import sys + +n, p = map(int, sys.stdin.readline().split()) +answer = 0 + +guitar = {} +line = 0 +for i in range(n): + newLine, newP = map(int, sys.stdin.readline().split()) + + + if line != newLine and newLine not in guitar: + tmp = [newP] + guitar[newLine] = tmp + answer += 1 + elif (line != newLine and newLine in guitar) or line == newLine: + tmp = guitar[newLine] + while tmp[-1] > newP: + tmp.pop(); answer += 1 + if len(tmp) == 0: break + if len(tmp) == 0: + tmp.append(newP) + answer += 1 + elif tmp[-1] < newP: + tmp.append(newP) + answer += 1 + + line = newLine + +print(answer) \ No newline at end of file From 606df615f7f8dadc5fc1a58fb7749c698d16c956 Mon Sep 17 00:00:00 2001 From: 12novel30 <79260472+12novel30@users.noreply.github.com> Date: Mon, 6 Feb 2023 16:46:10 +0900 Subject: [PATCH 09/13] Dessert: [DS] --- .../FromRestaurant/dataStructure_tmp/1715.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 ggangchongs/Angora/FromRestaurant/dataStructure_tmp/1715.py diff --git a/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/1715.py b/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/1715.py new file mode 100644 index 0000000..48a64db --- /dev/null +++ b/ggangchongs/Angora/FromRestaurant/dataStructure_tmp/1715.py @@ -0,0 +1,16 @@ +import sys +import heapq + +n = int(sys.stdin.readline()) +heap = [] +for i in range(n): heapq.heappush(heap, int(sys.stdin.readline())) + +answer = 0 +while len(heap)>=2: + first = heapq.heappop(heap) + second = heapq.heappop(heap) + answer += first + second + if len(heap) == 0: break + else: heapq.heappush(heap, first + second) + +print(answer) \ No newline at end of file From ed304022c3896d5e42da74b415b733ce4d7922db Mon Sep 17 00:00:00 2001 From: 12novel30 <79260472+12novel30@users.noreply.github.com> Date: Mon, 6 Feb 2023 16:47:59 +0900 Subject: [PATCH 10/13] =?UTF-8?q?Day:=2023-02-04=20Sat,=20Greedy,=20?= =?UTF-8?q?=EA=B5=AC=EB=AA=85=EB=B3=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Angora/7days/Greedy/Feb_1st_lifeBoat.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ggangchongs/Angora/7days/Greedy/Feb_1st_lifeBoat.py diff --git a/ggangchongs/Angora/7days/Greedy/Feb_1st_lifeBoat.py b/ggangchongs/Angora/7days/Greedy/Feb_1st_lifeBoat.py new file mode 100644 index 0000000..62e60d9 --- /dev/null +++ b/ggangchongs/Angora/7days/Greedy/Feb_1st_lifeBoat.py @@ -0,0 +1,24 @@ +def solution(people, limit): + people = sorted(people, reverse=True) + i,j = 0, len(people)-1 + answer = 0 + + while i < j: + tmp = people[i] + people[j] + if tmp <= limit: + while tmp + people[j-1] <= limit: + tmp += people[j-1] + j -= 1 + i += 1 + j -= 1 + answer += 1 + else: + i += 1 + answer += 1 + if i == j: answer += 1 + + return answer + +people = [70, 50, 50, 10, 20] +limit = 100 +print(solution(people, limit)) \ No newline at end of file From 2bafe8749999f8d10e3afb7f7a04ab8aab5b8bc2 Mon Sep 17 00:00:00 2001 From: 12novel30 <79260472+12novel30@users.noreply.github.com> Date: Mon, 6 Feb 2023 16:48:42 +0900 Subject: [PATCH 11/13] =?UTF-8?q?Day:=2023-02-05=20Sun,=20DP,=20=EC=A0=95?= =?UTF-8?q?=EC=88=98=EC=82=BC=EA=B0=81=ED=98=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ggangchongs/Angora/7days/DP/Feb_1st_intTriangle.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 ggangchongs/Angora/7days/DP/Feb_1st_intTriangle.py diff --git a/ggangchongs/Angora/7days/DP/Feb_1st_intTriangle.py b/ggangchongs/Angora/7days/DP/Feb_1st_intTriangle.py new file mode 100644 index 0000000..50fa479 --- /dev/null +++ b/ggangchongs/Angora/7days/DP/Feb_1st_intTriangle.py @@ -0,0 +1,12 @@ +def solution(triangle): + higher = triangle[0] + + for i in range(1, len(triangle)): + now = triangle[i] + for j in range(len(now)): + if j == 0: now[j] += higher[0] + elif j == len(now)-1: now[j] += higher[j-1] + else: now[j] += max(higher[j-1], higher[j]) + higher = now + + return max(higher) \ No newline at end of file From 5b3bec6623a2e7c3f69a00c611b5581fd7f41a34 Mon Sep 17 00:00:00 2001 From: 12novel30 <79260472+12novel30@users.noreply.github.com> Date: Mon, 6 Feb 2023 16:49:35 +0900 Subject: [PATCH 12/13] =?UTF-8?q?Day:=2023-02-06=20Mon,=20DFS&BFS,=20?= =?UTF-8?q?=EA=B2=8C=EC=9E=84=20=EB=A7=B5=20=EC=B5=9C=EB=8B=A8=EA=B1=B0?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../7days/BFS&DFS/Feb_1st_shortestPath.py | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 ggangchongs/Angora/7days/BFS&DFS/Feb_1st_shortestPath.py diff --git a/ggangchongs/Angora/7days/BFS&DFS/Feb_1st_shortestPath.py b/ggangchongs/Angora/7days/BFS&DFS/Feb_1st_shortestPath.py new file mode 100644 index 0000000..370573d --- /dev/null +++ b/ggangchongs/Angora/7days/BFS&DFS/Feb_1st_shortestPath.py @@ -0,0 +1,31 @@ +from collections import deque + +def solution(maps): + queue = deque() + step = [(-1,0), (1,0), (0,-1), (0,1)] # 상 하 좌 우 + answer = bfs_maze(0,0, queue, step, maps) + if answer == 1: return -1 + else: return answer + +def bfs_maze(x,y, queue, step, maps): + n,m = len(maps), len(maps[0]) + queue.append((x,y)) + + while queue: + x, y = queue.popleft() + for act in step: + nx, ny = x + act[0], y + act[1] + + # 벗어나면 패스 + if nx < 0 or nx >= n or ny < 0 or ny >= m: continue + # 벽이면 패스 + if maps[nx][ny] == 0: continue + # 이동 가능할 경우 + if maps[nx][ny] == 1: + maps[nx][ny] = maps[x][y] + 1 + queue.append((nx,ny)) + + return maps[n-1][m-1] + +maps = [[1,0,1,1,1],[1,0,1,0,1],[1,0,1,1,1],[1,1,1,0,1],[0,0,0,0,1]] +print(solution(maps)) \ No newline at end of file From b9c66bd85fb6924687e811b124b79bd7a4e80989 Mon Sep 17 00:00:00 2001 From: 12novel30 <79260472+12novel30@users.noreply.github.com> Date: Mon, 6 Feb 2023 17:40:09 +0900 Subject: [PATCH 13/13] =?UTF-8?q?Day:=2023-02-07=20Tue,=20Graph,=20?= =?UTF-8?q?=EA=B0=80=EC=9E=A5=20=EB=A8=BC=20=EB=85=B8=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../7days/Graph/Feb_1st_furthestNode.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ggangchongs/Angora/7days/Graph/Feb_1st_furthestNode.py diff --git a/ggangchongs/Angora/7days/Graph/Feb_1st_furthestNode.py b/ggangchongs/Angora/7days/Graph/Feb_1st_furthestNode.py new file mode 100644 index 0000000..afdf7ec --- /dev/null +++ b/ggangchongs/Angora/7days/Graph/Feb_1st_furthestNode.py @@ -0,0 +1,23 @@ +from collections import deque + +def solution(n, edge): + connect = [[] for _ in range(n+1)] + for a,b in edge: + connect[a].append(b) + connect[b].append(a) + + visited = [0]*(n+1) + visited[1] = 1 + queue = deque([1]) + while queue: + now = queue.popleft() + for next in connect[now]: + if not visited[next]: + visited[next] = visited[now] + 1 + queue.append(next) + + return visited.count(max(visited)) + +n = 6 +vertex = [[3, 6], [4, 3], [3, 2], [1, 3], [1, 2], [2, 4], [5, 2]] +print(solution(n, vertex)) \ No newline at end of file