목록전체 글 (124)
.Zzumbong
난이도 [ 👿 ] Hard 문제 설명 A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear in the sequence at most once. Note that the path does not need to pass through the root. The path sum of a path is the sum of the node's values in the path. Given the root of a binary tree, return the maximum path sum of any non..
난이도 [ 🤔 ] Medium 문제 설명 Given the root of a binary tree, split the binary tree into two subtrees by removing one edge such that the product of the sums of the subtrees is maximized. Return the maximum product of the sums of the two subtrees. Since the answer may be too large, return it modulo 109 + 7. Note that you need to maximize the answer before taking the mod and not after taking it. 문제가 좀 복..
난이도 [ 🤔 ] Medium 문제 설명 Given the root of a binary tree, find the maximum value v for which there exist different nodes a and b where v = |a.val - b.val| and a is an ancestor of b. A node a is an ancestor of b if either: any child of a is equal to b or any child of a is an ancestor of b. 이진트리의 상위, 하위 노드의 a-b 의 최대값을 찾는 문제다. 입출력 예 Example 1: Input: root = [8,3,10,1,6,null,14,null,null,4,7,13] Outpu..
난이도 [ 😊 ] Easy 문제 설명 Consider all the leaves of a binary tree, from left to right order, the values of those leaves form a leaf value sequence. For example, in the given tree above, the leaf value sequence is (6, 7, 4, 9, 8). Two binary trees are considered leaf-similar if their leaf value sequence is the same. Return true if and only if the two given trees with head nodes root1 and root2 are le..
난이도 [ 😊 ] Easy 문제 설명 Given the root node of a binary search tree and two integers low and high, return the sum of values of all nodes with a value in the inclusive range [low, high]. 2진 트리의 노드 값이 low, high 범위에 들어오면 모두 더해서 return 한다. 입출력 예 Example 1: Input: root = [10,5,15,3,7,null,18], low = 7, high = 15 Output: 32 Explanation: Nodes 7, 10, and 15 are in the range [7, 15]. 7 + 10 + 15 = 32. Exam..
개당 6500원 2개를 샀다. 재발매를 예약해서 거의 4개월만에 도착 정말 다 귀엽다. 중복만 아니길 바라며 2개만 구매 짠 고양이 하치와레와 토끼 우사기! 어흑 자는 모습 기여워 풀뽑기 자격증 3급을 바라보는 당당한 우사기 안타깝게 치이카와는 안나왔지만 나머지 둘도 귀여우니까
난이도 [ 🤔 ] Medium 문제 설명 Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list. The first node is considered odd, and the second node is even, and so on. Note that the relative order inside both the even and odd groups should remain as it was in the input. You must solve the problem in O(1) extra..
난이도 [ 😊 ] Easy 문제 설명 Given the head of a singly linked list, return the middle node of the linked list. If there are two middle nodes, return the second middle node. 단일 linked List 를 준다. list의 중간 부터 return하는데, 중간이 2개 인 경우(짝수 length) 일땐, 2번째 중간 값 부터 return 해준다. 입출력 예 Example 1: Input: head = [1,2,3,4,5] Output: [3,4,5] Explanation: The middle node of the list is node 3. Example 2: Input: head = [..
난이도 [ 🤔 ] Medium 문제 설명 You are given a 0-indexed integer array nums of length n. The average difference of the index i is the absolute difference between the average of the first i + 1 elements of nums and the average of the last n - i - 1 elements. Both averages should be rounded down to the nearest integer. Return the index with the minimum average difference. If there are multiple such indice..
난이도 [ 🤔 ] Medium 문제 설명 Given a string s, sort it in decreasing order based on the frequency of the characters. The frequency of a character is the number of times it appears in the string. Return the sorted string. If there are multiple answers, return any of them. 문자열 s에 문자가 등장횟수만큼 내림차순 정렬한다. aaaccc, cccaaa 는 둘다 정답이란다. 숫자만 신경쓰면 된다. 입출력 예 Example 1: Input: s = "tree" Output: "eert" Explanation: ..
난이도 [ 🤔 ] Medium 문제 설명 Two strings are considered close if you can attain one from the other using the following operations: Operation 1: Swap any two existing characters. For example, abcde -> aecdb Operation 2: Transform every occurrence of one existing character into another existing character, and do the same with the other character. For example, aacabb -> bbcbaa (all a's turn into b's, and..
난이도 [ 😊 ] Easy 문제 설명 You are given a string s of even length. Split this string into two halves of equal lengths, and let a be the first half and b be the second half. Two strings are alike if they have the same number of vowels ('a','e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'). Notice that s contains uppercase and lowercase letters. Return true if a and b are alike. Otherwise, return false. 짝수 ..
난이도 [ 😊 ] Easy 문제 설명 Given an array of integers arr, return true if the number of occurrences of each value in the array is unique, or false otherwise. int 로 이루어진 arr가 있다. 여기에 나오는 숫자가 발생횟수가 유니크 할때 true이다. 입출력 예 Example 1: Input: arr = [1,2,2,1,1,3] Output: true Explanation: The value 1 has 3 occurrences, 2 has 2 and 3 has 1. No two values have the same number of occurrences. 1은 3번, 2는 2번, 3은 1번 ..
난이도 [ 🤔 ] Medium 문제 설명 Implement the RandomizedSet class: RandomizedSet() Initializes the RandomizedSet object. bool insert(int val) Inserts an item val into the set if not present. Returns true if the item was not present, false otherwise. bool remove(int val) Removes an item val from the set if present. Returns true if the item was present, false otherwise. int getRandom() Returns a random ele..
동숲에서 친구 섬에 놀러갈때 느낌이 물씬 난다. 아 이거 힐링이구나 !! Nexon에서 만든 얼리 엑세스 게임으로 24,000원에 인디에 적당한 가격. 카트 30일 이용권보다 싼 게임이 넥슨에서 나오네? 사실 나는 서빙과 녹차셔틀맨 아침부터 저녁까지 2번의 다이빙, 거기다가 야간 다이빙도 하고 초밥집에서 알바까지 하는 미친 체력의 소유자 Dave 그리고 기본적으로 200미터까진 그냥 들어가는 미친 몸. 중간 중간 쉬는 시간에는 농사와 가두리 양식도 한다. 가끔씩 새로운 요리를 내면 손님들이 쿡스타에 올려준다. 총평! 가성비 ⭐⭐⭐⭐⭐ 2.4만원에 할 수 있는 정말 유니크한 경험. 그래픽 ⭐⭐⭐⭐⭐⭐ 도트에서 보여줄 수 있는 최고의 비주얼. 유닛하나 장면하나 허투루 만들지 않았다. 장인정신이 돋보인다. 게..
문제 설명 You are given an integer array matches where matches[i] = [winneri, loseri] indicates that the player winneri defeated player loseri in a match. Return a list answer of size 2 where: answer[0] is a list of all players that have not lost any matches. answer[1] is a list of all players that have lost exactly one match. The values in the two lists should be returned in increasing order. Note:..
문제 설명 Given an integer array nums, return the number of all the arithmetic subsequences of nums. A sequence of numbers is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same. For example, [1, 3, 5, 7, 9], [7, 7, 7, 7], and [3, -1, -5, -9] are arithmetic sequences. For example, [1, 1, 2, 5, 7] is not an arithmetic sequ..
잠실 새내에 아니 감성주점인가.. 펍인가 모를 몬가가 생겼다. 육회는 언제나 옳다. 존맛탱. 차돌순두부짬뽕은 엄청나게 쫄깃한 면빨과 매콤(신라면 수준) 짬뽕맛이 일품이였다. 술이 땡긴다기 보단 밥이 땡길정도로 맛있다. 첫 번째 방문 때는 그냥 겉만 번지르르 할 것 같아서 조금 긴장했지만 생각보다 음식에 진심이다. 앵간한 육회, 짬뽕 전문점 수준의 맛과 퀄리티가 보장된다. 꼭 한번 쯤 가보고 맛보는 것을 추천
문제 설명 Given an array of integers arr, find the sum of min(b), where b ranges over every (contiguous) subarray of arr. Since the answer may be large, return the answer modulo 109 + 7. 정수 배열에서 min(b)의 합을 구하는데, b는 arr의 모든 연속된 하위 배열이란다. 예제를 보면 이해하 간다. 숫자가 크니까 modulo로 나머지를 리턴하란다. 입출력 예 Example 1: Input: arr = [3,1,2,4] Output: 17 Explanation: Subarrays are [3], [1], [2], [4], [3,1], [1,2], [2,4], [3,..
여느 때처럼 침착맨 채널을 보고 댓글을 보는데 어라? 이게 모야 @user-* 로 된 아이디들이 많이 보였다. 닉네임이 부적절해서 강제 변경되었다기엔 90% 이상의 사람들이 이런 식이였다. 그 이유는 handle 이라는 기능이 업데이트 되었는데, youtube.com/asdasdas 이러첨 고유 주소가 너무 길고 복잡했기 때문에 변경되는 것같다. 당장은 댓글부터 업데이트 된듯 내 핸들 내임을 변경하기 https://www.youtube.com/handle 위 사이트에 접속하여 핸들 변경 클릭 당장은 많은 사람들이 변경하지 못해서 짧고 좋은 닉네임들을 선점할 수 있다. 말은 예약으로 되어있는데 확인하자마자 댓글을 써봤는데 잘 나온다. 아마도 몇 달전 메일로 handle 기능 소개 메일에서 오픈된 주소라서 ..