- Today
- Total
목록leetcode (186)
작심삼일

문제 링크: https://leetcode.com/problems/letter-combinations-of-a-phone-number/ 문제 Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters. 조건 0
문제 링크: https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii/ 문제 You are given a string s and an integer k, a k duplicate removal consists of choosing k adjacent and equal letters from s and removing them, causing the left and the right side of the deleted substring to concatenate together. We repeatedly make k duplicate removals on s until we no longer can. Return the final ..
문제 링크: https://leetcode.com/problems/max-number-of-k-sum-pairs/ 문제 You are given an integer array nums and an integer k. In one operation, you can pick two numbers from the array whose sum equals k and remove them from the array. Return the maximum number of operations you can perform on the array. 조건 1
문제 링크: https://leetcode.com/problems/shortest-unsorted-continuous-subarray/ 문제 Given an integer array nums, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order. Return the shortest such subarray and output its length. 조건 1
문제 링크: https://leetcode.com/problems/sort-array-by-parity/ 문제 Given an integer array nums, move all the even integers at the beginning of the array followed by all the odd integers. Return any array that satisfies this condition. 조건 1
문제 링크: https://leetcode.com/problems/path-with-minimum-effort/ 문제 You are a hiker preparing for an upcoming hike. You are given heights, a 2D array of size rows x columns, where heights[row][col] represents the height of cell (row, col). You are situated in the top-left cell, (0, 0), and you hope to travel to the bottom-right cell, (rows-1, columns-1) (i.e., 0-indexed). You can move up, down, le..
문제 링크: https://leetcode.com/problems/smallest-string-with-swaps/ 문제 You are given a string s, and an array of pairs of indices in the string pairs where pairs[i] = [a, b] indicates 2 indices(0-indexed) of the string. You can swap the characters at any pair of indices in the given pairs any number of times. Return the lexicographically smallest string that s can be changed to after using the swap..
문제 링크: https://leetcode.com/problems/min-cost-to-connect-all-points/ 문제 You are given an array points representing integer coordinates of some points on a 2D-plane, where points[i] = [$x_i, y_i$]. The cost of connecting two points [$x_i, y_i$] and [$x_j, y_j$] is the manhattan distance between them: |$x_i - x_j$| + |$y_i - y_j$|, where |val| denotes the absolute value of val. Return the minimum ..