全站内容
medium
2683. Neighboring Bitwise XOR
#Problem A 0-indexed array derived with length n is derived by computing the bitwise XOR (⊕) of adjacent values in a binary array original of length n. Specifically, for each index i in the range [0, n - 1]: If i = n - 1, then derived[i] = …
2425. Bitwise XOR of All Pairings
#Problem 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 …
2429. Minimize XOR
#Problem Given two positive integers num1 and num2, find the positive integer x such that: x has the same number of set bits as num2, and The value x XOR num1 is minimal. Note that XOR is the bitwise XOR operation. Return the integer x. The …
3066. Minimum Operations to Exceed Threshold Value II
#Problem You are given a 0-indexed integer array nums, and an integer k. In one operation, you will: Take the two smallest integers x and y in nums. Remove x and y from nums. Add min(x, y) * 2 + max(x, y) anywhere in the array. Note that …
2657. Find the Prefix Common Array of Two Arrays
#Problem 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. Return …
3223. Minimum Length of String After Operations
#Problem 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 …
2116. Check if a Parentheses String Can Be Valid
#Problem A parentheses string is a non-empty 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 …
2275. Largest Combination With Bitwise AND Greater Than Zero
#Problem The bitwise AND of an array nums is the bitwise AND of all integers in nums. For example, for nums = [1, 5, 3], the bitwise AND is equal to 1 & 5 & 3 = 1. Also, for nums = [7], the bitwise AND is 7. You are given an array of …
1400. Construct K Palindrome Strings
#Problem 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. https://leetcode.com/problems/construct-k-palindrome-strings/ Example 1: Input: s = …
916. Word Subsets
#Problem 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 …