목록2024/05 (33)
넘치게 채우기
https://leetcode.com/problems/single-number-iii/description/leetcode - Single Number III문제 유형 : 비트마스킹문제 난이도 : Medium 문제Given an integer array nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once. You can return the answer in any order.You must write an algorithm that runs in linear runtime complexity and..
https://leetcode.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/description/leetcode - Count Triplets That Can Form Two Arrays of Equal XOR문제 유형 : 부분합, 비트마스킹문제 난이도 : Medium 문제Given an array of integers arr.We want to select three indices i, j and k where (0 Let's define a and b as follows:a = arr[i] ^ arr[i + 1] ^ ... ^ arr[j - 1]b = arr[j] ^ arr[j + 1] ^ ... ^ arr[k]Note that..
https://leetcode.com/problems/number-of-steps-to-reduce-a-number-in-binary-representation-to-one/description/leetcode - Number of Steps to Reduce a Number in Binary Representation to One문제 유형 : 비트마스킹, 그리디문제 난이도 : Medium 문제Given the binary representation of an integer as a string s, return the number of steps to reduce it to 1 under the following rules:If the current number is even, you have to d..
https://leetcode.com/problems/get-equal-substrings-within-budget/description/leetcode - Get Equal Substrings Within Budget문제 유형 : 문자열 처리, 슬라이딩 윈도우문제 난이도 : Medium 문제You are given two strings s and t of the same length and an integer maxCost.You want to change s to t. Changing the ith character of s to ith character of t costs |s[i] - t[i]| (i.e., the absolute difference between the ASCII values o..
https://leetcode.com/problems/special-array-with-x-elements-greater-than-or-equal-x/description/leetcode - Special Array With X Elements Greater Than or Equal X문제 유형 : 이진 탐색문제 난이도 : Easy 문제You are given an array nums of non-negative integers. nums is considered special if there exists a number x such that there are exactly x numbers in nums that are greater than or equal to x.Notice that x does ..
https://leetcode.com/problems/student-attendance-record-ii/description/?envType=daily-question&envId=2024-05-26leetcode - Student Attendance Record II문제 유형 : 다이나믹 프로그래밍문제 난이도 : Hard 문제An attendance record for a student can be represented as a string where each character signifies whether the student was absent, late, or present on that day. The record only contains the following three characters..
https://leetcode.com/problems/word-break-ii/description/leetcode - Word Break II문제 유형 : 문자열 처리, 다이나믹 프로그래밍문제 난이도 : Hard 문제Given a string s and a dictionary of strings wordDict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible sentences in any order.Note that the same word in the dictionary may be reused multiple times in the segmentatio..
https://leetcode.com/problems/maximum-score-words-formed-by-letters/description/leetcode - Maximum Score Words Formed by Letters문제 유형 : 재귀, 백트래킹, dfs, 문자열 처리문제 난이도 : Hard 문제Given a list of words, list of single letters (might be repeating) and score of every character.Return the maximum score of any valid set of words formed by using the given letters (words[i] cannot be used two or more times)..
https://leetcode.com/problems/the-number-of-beautiful-subsets/description/leetcode - The Number of Beautiful Subsets문제 유형 : 백트래킹, dfs, 재귀문제 난이도 : Medium 문제You are given an array nums of positive integers and a positive integer k.A subset of nums is beautiful if it does not contain two integers with an absolute difference equal to k.Return the number of non-empty beautiful subsets of the array nu..
https://leetcode.com/problems/palindrome-partitioning/description/leetcode - Palindrome Partitioning문제 유형 : 문자열 처리, 재귀, dfs, 백트래킹문제 난이도 : Medium 문제Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. 문자열 s가 주어진다.모든 (s를 쪼갠 조각들이 팰린드롬 문자열)인 집합들을 반환하시오. ex-> "aab"는 ["a", "a", "b"]로 나누면 모두 팰린드롬인 문자열들로 나눈 것입니다. 풀이재귀..