목록LeetCode (522)
넘치게 채우기
https://leetcode.com/problems/bitwise-xor-of-all-pairings/description/leetcode - Bitwise XOR of All Pairings문제 유형: 비트마스킹문제 난이도: Medium 문제You are given two 0-indexed arrays, nums1 and nums2, consisting of non-negative integers. There exists another array, nums3, which contains the bitwise XOR of all pairings of integers between nums1 and nums2 (every integer in nums1 is paired with every integer ..
https://leetcode.com/problems/minimize-xor/description/leetcode - Minimize XOR문제 유형: 비트마스킹, 그리디문제 난이도: Medium 문제Given two positive integers num1 and num2, find the positive integer x such that:x has the same number of set bits as num2, andThe value x XOR num1 is minimal.Note that XOR is the bitwise XOR operation.Return the integer x. The test cases are generated such that x is uniquely determine..
https://leetcode.com/problems/find-the-prefix-common-array-of-two-arrays/description/leetcode - Find the Prefix Common Array of Two Arrays문제 유형: 구현, 카운팅, 구간합문제 난이도: Medium 문제You are given two 0-indexed integer permutations A and B of length n.A prefix common array of A and B is an array C such that C[i] is equal to the count of numbers that are present at or before the index i in both A and B.Re..
https://leetcode.com/problems/minimum-length-of-string-after-operations/description/leetcode - Minimum Length of String After Operations문제 유형: 문자열 처리, 그리디문제 난이도: Medium 문제You are given a string s.You can perform the following process on s any number of times:Choose an index i in the string such that there is at least one character to the left of index i that is equal to s[i], and at least one ch..
https://leetcode.com/problems/check-if-a-parentheses-string-can-be-valid/description/leetcode - Check if a Parentheses String Can Be Valid문제 유형: 문자열 처리, 2-pass문제 난이도: Medium 문제A parentheses string is a nonempty string consisting only of '(' and ')'. It is valid if any of the following conditions is true:It is ().It can be written as AB (A concatenated with B), where A and B are valid parentheses..
https://leetcode.com/problems/construct-k-palindrome-strings/description/leetcode - Construct K Palindrome Strings문제 유형: 문자열 처리, 팰린드롬문제 난이도: Medium 문제Given a string s and an integer k, return true if you can use all the characters in s to construct k palindrome strings or false otherwise. 문자열 s와 정수 k가 주어집니다. 만약 s의 글자들로 k개의 팰린드롬 문자열로 만들 수 있으면 true를 아니면 false를 반환하시오. 풀이꽤 트리키해 보일 수 있지만, 문제를 간단하게 만들..
https://leetcode.com/problems/word-subsets/description/leetcode - Word Substts문제 유형: 문자열 처리, 집합문제 난이도: Medium 문제You are given two string arrays words1 and words2.A string b is a subset of string a if every letter in b occurs in a including multiplicity.For example, "wrr" is a subset of "warrior" but is not a subset of "world".A string a from words1 is universal if for every string b in words2, b..
https://leetcode.com/problems/counting-words-with-a-given-prefix/description/leetcode - Counting Words With a Given Prefix문제 유형: 문자열 처리문제 난이도: Easy 문제You are given an array of strings words and a string pref.Return the number of strings in words that contain pref as a prefix.A prefix of a string s is any leading contiguous substring of s. 문자열 배열 words와 문자열 pref를 받는다.pref를 prefix로 가지는 문자열의 개수를 구하..
https://leetcode.com/problems/count-prefix-and-suffix-pairs-i/description/leetcode - Count Prefix and Suffix Pairs I문제 유형: 문자열 처리문제 난이도: Easy 문제You are given a 0-indexed string array words.Let's define a boolean function isPrefixAndSuffix that takes two strings, str1 and str2:isPrefixAndSuffix(str1, str2) returns true if str1 is both a prefix and a suffix of str2, and false otherwise.For example..
https://leetcode.com/problems/string-matching-in-an-array/description/leetcode - String Matching in an Array문제 유형: 문자열 처리문제 난이도: Easy 문제Given an array of string words, return all strings in words that is a substring of another word. You can return the answer in any order.A substring is a contiguous sequence of characters within a string 문자열 배열 words가 주어집니다. word의 다른 단어의 부분문자열인 문자열을 담아서 반환하시오.순서는..