- Today
- Total
목록leetcode (186)
작심삼일
문제 링크: https://leetcode.com/problems/koko-eating-bananas/ 문제 Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours. Koko can decide her bananas-per-hour eating speed of k. Each hour, she chooses some pile of bananas and eats k bananas from that pile. If the pile has less than k bananas, she eats all of them ..
문제 링크: https://leetcode.com/problems/linked-list-cycle-ii/ 문제 Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null. There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail's next pointer is connec..
문제 링크: https://leetcode.com/problems/word-pattern/ 문제 Given a pattern and a string s, find if s follows the same pattern. Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in s. 조건 1

문제 링크: https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/ 문제 There are some spherical balloons taped onto a flat wall that represents the XY-plane. The balloons are represented as a 2D integer array points where points[i] = [$x_{start}, x_{end}$] denotes a balloon whose horizontal diameter stretches between $x_{start}$ and $x_{end}$. You do not know the exact y-coordinates..
문제 링크: https://leetcode.com/problems/insert-into-a-binary-search-tree/ 문제 You are given the root node of a binary search tree (BST) and a value to insert into the tree. Return the root node of the BST after the insertion. It is guaranteed that the new value does not exist in the original BST. Notice that there may exist multiple valid ways for the insertion, as long as the tree remains a BST aft..
문제 링크: https://leetcode.com/problems/add-binary/ 문제 Given two binary strings a and b, return their sum as a binary string. 조건 1 Nb: Rb += '0' * (Na-Nb) elif Nb > Na: Ra += '0' * (Nb-Na) t = 0 for ta, tb in zip(Ra, Rb): s = t + int(ta) + int(tb) if s == 0: ans += '0' t = 0 elif s == 1: ans += '1' t = 0 elif s == 2: ans += '0' t = 1 elif s == 3: ans += '1' t = 1 ans += str(t) if ans[-1] == '0': re..
문제 링크: https://leetcode.com/problems/car-pooling/ 문제 There is a car with capacity empty seats. The vehicle only drives east (i.e., it cannot turn around and drive west). You are given the integer capacity and an array trips where trip[i] = [$numPassengers^i, from^i, to^i$] indicates that the $i^{th}$ trip has $numPassengers^i$ passengers and the locations to pick them up and drop them off are $f..
문제 링크: https://leetcode.com/problems/palindrome-partitioning/ 문제 Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. A palindrome string is a string that reads the same backward as forward. 조건 1