목록코딩 테스트 (165)
개발 일지
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems connected and it will automatically contact the police if two adjacent houses were broken into on the same night. Given an integer array nums representing the amount of money..

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]. 이진 탐색 트리의 root 노드와 두 정수 low과 high가 주어지면 포함 범위 [low, high]에 있는 값을 가진 모든 노드의 값 합계를 반환합니다. 예시 1: 입력: root = [10, 5, 15, 3, 7, null, 18], low = 7, high = 15 출력: 32 설명: 노드 7, 10, 15는 범위 [7, 15]에 있습니다. 7 + 10 + 15 = 32. 예시 2: 입력: root = [10, ..
Given an integer n, return a string array answer (1-indexed) where: answer[i] == "FizzBuzz" if i is divisible by 3 and 5. answer[i] == "Fizz" if i is divisible by 3. answer[i] == "Buzz" if i is divisible by 5. answer[i] == i (as a string) if none of the above conditions are true. 정수 n이 주어지면 무자열 배열 응답(1 - 인덱스)을 반환합니다. i가 3과 5로 나누어 떨이진다면 answer[i] == "FizzBuzz" i가 3으로 나누어 떨어진다면 answer[i] == "Fizz"..
We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wrong, I will tell you whether the number I picked is higher or lower than your guess. You call a pre-defined API int guess(int num), which returns three possible results: -1: Your guess is higher than the number I picked (i.e. num > pick). 1: Your gue..

You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation. n * n이미지를 나타내는 2D 가 주어지면 matrix이미지를 시계 방향으로 90도 회전합니다. 이미지를 제자리에서 회전해야 합니다. 즉, 입력 2D 매트릭스를 직접 수정해야 합니다. 다른 2D 매트릭스를 할당하고 회전하지 마십시오. 예시 1: 입력: m..
Given a string s, find the first non-repeating character in it and return its index. If it does not exist, return -1. 문자열 s가 주어질 때, 그 안에서 반복되지 않는 첫 번째 문자를 찾고 해당 인덱스를 반환합니다. 존재하지 않으면 -1을 반환합니다. 예시 1: 입력: s = "leetcode" 출력: 0 예시 2: 입력: s = "loveleetcode" 출력: 2 예시 3: 입력: s = "aabb" 출력: -1 조건: s는 영문 소문자로만 구성되어 있습니다. 정답: public class Solution { public int FirstUniqChar(string s) { Boolean[] isChecked..
Given a string s of lower and upper case English letters.A good string is a string which doesn't have two adjacent characters s[i] and s[i + 1] where:0 s[i] is a lower-case letter and s[i + 1] is the same letter but in upper-case or vice-versa.To make the string good, you can choose two adjacent characters that make the string bad and remove them. You can keep doing this until the string becomes..
Given a string s of lower and upper case English letters. A good string is a string which doesn't have two adjacent characters s[i] and s[i + 1] where: 0 "abBA" --> "aA" --> "" 예시 3: 예 3: 입력: s = "s" 출력: "s" 조건: 1
Given a string s, reverse only all the vowels in the string and return it. The vowels are 'a', 'e', 'i', 'o', and 'u', and they can appear in both lower and upper cases, more than once. 문자열 s가 주어질 때, 문자열의 모든 모음만 뒤집은 문자열을 반환하세요. 모음은 'a', 'e', 'i', 'o', 'u'이며, 대문자와 소문자 모두 한 번 이상 나타날 수 있습니다. 예시 1: 입력: s = "hello" 출력: "holle" 예시 2: 입력: s = "leetcode" 출력: "leotcede" 조건: 1

Given an m x n matrix, return true if the matrix is Toeplitz. Otherwise, return false. A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same elements. m x n 행렬이 주어졌을 때, 이 행렬이 퇴플리츠일 경우 true를 그렇지 않을 경우 false를 반환하세요. 행렬이 왼쪽 위부터 오른쪽 아래까지의 모든 대각선이 동일한 요소를 갖는 경우 토플리츠입니다. 예시 1: 입력: matrix = [[1,2,3,4],[5,1,2,3],[9,5,1,2]] 출력: true 설명: 위 그리드에서 대각선은 "[9]", "[5, 5]", "[1, 1, 1]..