[Easy] 104. Maximum Depth of Binary Tree
leetCode 2022. 6. 6. 16:59

문제 Given the root of a binary tree, return its maximum depth. A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. 이진 root트리의 최대 깊이를 반환합니다 . 이진 트리의 최대 깊이 는 루트 노드에서 가장 먼 잎 노드까지 가장 긴 경로를 따라 있는 노드의 수입니다. 예시 Example 1: Input: root = [3,9,20,null,null,15,7] Output: 3 Example 2: Input: root = [1,null,2] Output: 2 제약 조건 Constrain..

[Easy] 876. Middle of the Linked List
leetCode 2022. 6. 6. 14:35

문제 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. head단일 연결 목록이 주어지면 연결 목록 의 중간 노드를 반환합니다 . 두 개의 중간 노드가 있는 경우 두 번째 중간 노드를 반환 합니다. 예시 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 = [1,2,3,4,5,6] Output: [4,5,6] Explana..

[Easy] 1290. Convert Binary Number in a Linked List to Integer
leetCode 2022. 6. 6. 14:25

문제 Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary representation of a number. Return the decimal value of the number in the linked list. 단일 head연결 목록에 대한 참조 노드가 지정됩니다. 연결 목록의 각 노드 값은 0또는 1입니다. 연결 목록은 숫자의 이진 표현을 보유합니다. 연결 목록에 있는 숫자 의 10진수 값 을 반환합니다 . 예시 Example 1: Input: head = [1,0,1] Outp..

[Easy] 389. Find the Difference
leetCode 2022. 6. 2. 12:12

문제 You are given two strings s and t. String t is generated by random shuffling string s and then add one more letter at a random position. Return the letter that was added to t. 두 개의 문자열과 t가 주어집니다. 문자열 t는 임의의 셔플링 문자열에 의해 생성된 다음 임의의 위치에 문자를 하나 더 추가합니다. t에 추가된 문자를 반환한다. 예시 Example 1: Input: s = "abcd", t = "abcde" Output: "e" Explanation: 'e' is the letter that was added. Example 2: Input: s = ""..

[Easy] 1678. Goal Parser Interpretation
leetCode 2022. 6. 2. 12:09

문제 You own a Goal Parser that can interpret a string command. The command consists of an alphabet of "G", "()" and/or "(al)" in some order. The Goal Parser will interpret "G" as the string "G", "()" as the string "o", and "(al)" as the string "al". The interpreted strings are then concatenated in the original order. Given the string command, return the Goal Parser's interpretation of command. 문자..

[Easy] 953. Verifying an Alien Dictionary
leetCode 2022. 6. 2. 12:07

문제 Easy 2841940Add to ListShare In an alien language, surprisingly, they also use English lowercase letters, but possibly in a different order. The order of the alphabet is some permutation of lowercase letters. Given a sequence of words written in the alien language, and the order of the alphabet, return true if and only if the given words are sorted lexicographically in this alien language. 외계..

[Easy] 1309. Decrypt String from Alphabet to Integer Mapping
leetCode 2022. 6. 2. 11:23

문제 You are given a string s formed by digits and '#'. We want to map s to English lowercase characters as follows: Characters ('a' to 'i') are represented by ('1' to '9') respectively. Characters ('j' to 'z') are represented by ('10#' to '26#') respectively. Return the string formed after mapping. The test cases are generated so that a unique mapping will always exist. s숫자 및 '#'로 구성된 문자열이 제공 됩니다..

[Easy] 709. To Lower Case
leetCode 2022. 6. 2. 10:48

문제 Given a string s, return the string after replacing every uppercase letter with the same lowercase letter. s 문자열이 주어졌을 때, 모든 대문자들을 소문자로 변환하여라. 예시 Example 1: Input: s = "Hello" Output: "hello" Example 2: Input: s = "here" Output: "here" Example 3: Input: s = "LOVELY" Output: "lovely" 제약 조건 Constraints: 1