본문 바로가기

전체 글67

304. Range Sum Query 2D - Immutable - 데일리 문제 304. Range Sum Query 2D - Immutable 난이도: Medium Given a 2D matrix matrix, handle multiple queries of the following type: Calculate the sum of the elements of matrix inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2). Implement the NumMatrix class: NumMatrix(int[][] matrix) Initializes the object with the integer matrix matrix. int sumRegion(int.. 2022. 6. 3.
867. Transpose Matrix - 데일리 문제 867. Transpose Matrix 난이도: Easy Given a 2D integer array matrix, return the transpose of matrix. The transpose of a matrix is the matrix flipped over its main diagonal, switching the matrix's row and column indices. Example 1: Input: matrix = [[1,2,3],[4,5,6],[7,8,9]] Output: [[1,4,7],[2,5,8],[3,6,9]] Example 2: Input: matrix = [[1,2,3],[4,5,6]] Output: [[1,4],[2,5],[3,6]] Constraints: m == matr.. 2022. 6. 2.
1461. Check If a String Contains All Binary Codes of Size K 문제 풀이 1461. Check If a String Contains All Binary Codes of Size K 난이도: Medium Given a binary string s and an integer k, return true if every binary code of length k is a substring of s. Otherwise, return false. Example 1: Input: s = "00110110", k = 2 Output: true Explanation: The binary codes of length 2 are "00", "01", "10" and "11". They can be all found as substrings at indices 0, 1, 3 and 2 respec.. 2022. 5. 31.
LeetCode - Biweekly Contest 79 LeetCode - Biweekly Contest 79 2283. Check if Number Has Equal Digit Count and Digit Value 난이도 : Easy You are given a 0-indexed string num of length n consisting of digits. Return true if for every index i in the range 0 2022. 5. 29.