[Medium] 1367. Linked List in Binary Tree
leetCode 2022. 6. 15. 08:50

문제 Given a binary tree root and a linked list with head as the first node. Return True if all the elements in the linked list starting from the head correspond to some downward path connected in the binary tree otherwise return False. In this context downward path means a path that starts at some node and goes downwards. 이진 트리 루트와 헤드를 첫 번째 노드로 하는 링크된 목록이 제공됩니다. 머리글에서 시작하는 링크된 목록의 모든 요소가 이진 트리에 연..

[Medium] 43. Multiply Strings
leetCode 2022. 6. 15. 08:45

문제 Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Note: You must not use any built-in BigInteger library or convert the inputs to integer directly. 문자열로 표현되는 음이 아닌 정수 num1과 num2가 주어지면 num1과 num2의 곱을 반환한다. 참고: 기본 제공 Big Integer 라이브러리를 사용하거나 입력을 정수로 직접 변환할 수 없습니다. 예시 Example 1: Input: num1 = "2", num2 = "3" O..

[Easy] 150. Evaluate Reverse Polish Notation
leetCode 2022. 6. 13. 13:44

문제 Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, and /. Each operand may be an integer or another expression. Note that division between two integers should truncate toward zero. It is guaranteed that the given RPN expression is always valid. That means the expression would always evaluate to a result, and there will not be any division b..

[Easy] 66. Plus One
leetCode 2022. 6. 13. 13:34

문제 You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most significant to least significant in left-to-right order. The large integer does not contain any leading 0's. Increment the large integer by one and return the resulting array of digits. 정수 배열 자릿수로 표현되는 큰 정수가 제공되며, 여기서 각 자릿수[i]는 정수의 i번째 자리..

[Easy] 110. Balanced Binary Tree
leetCode 2022. 6. 13. 01:44

문제 Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as : a binary tree in which the left and right subtrees of every node differ in height by no more than 1. 이진 트리가 주어지면 높이 균형이 맞는지 확인합니다. 이 문제에서 높이 균형 이진 트리는 다음과 같이 정의됩니다. : 모든 노드 의 왼쪽 및 오른쪽 하위 트리의 높이가 1 이하로 다른 이진 트리. 예시 Example 1: Input: root = [3,9,20,null,null,15,7] Output: tru..

[Easy] 459. Repeated Substring Pattern
leetCode 2022. 6. 13. 01:39

문제 Given a string s, check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. 문자열이 주어지면, 그 문자열의 부분 문자열이 원본 문자열을 여러 개로 구성할 수 있는지 판별하여 true, false를 반환하시오. 예시 ample 1: Input: s = "abab" Output: true Explanation: It is the substring "ab" twice. Example 2: Input: s = "aba" Output: false Example 3: Input: s = "abcabcabcabc" Output: true Explan..

[Easy] 896. Monotonic Array
leetCode 2022. 6. 9. 11:22

문제 An array is monotonic if it is either monotone increasing or monotone decreasing. An array nums is monotone increasing if for all i

[Easy] 28. Implement strStr()
leetCode 2022. 6. 9. 11:16

문제 Implement strStr(). Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Clarification: What should we return when needle is an empty string? This is a great question to ask during an interview. For the purpose of this problem, we will return 0 when needle is an empty string. This is consistent to C's s..