All Posts
Leetcode 2212: Maximum Points in an Archery Competition
Alice and Bob are opponents in an archery competition. Alice first shoots numArrows arrows, followed by Bob, in the target scoring sections from 0 to 11. The goal is to maximize Bob’s total score, ensuring that the sum of arrows shot by Bob equals numArrows.
Leetcode 2215: Find the Difference of Two Arrays
You are given two integer arrays, nums1 and nums2. Your task is to return a list of two arrays. The first array should contain all distinct integers that are in nums1 but not in nums2. The second array should contain all distinct integers that are in nums2 but not in nums1.
Leetcode 2216: Minimum Deletions to Make Array Beautiful
You are given an integer array nums. The array is considered beautiful if it satisfies the following conditions: the length of nums is even, and for every index i that is even (i % 2 == 0), nums[i] should not be equal to nums[i + 1]. You can remove any number of elements from nums to make it beautiful. Your goal is to return the minimum number of elements that need to be removed to make the array beautiful.
Leetcode 2217: Find Palindrome With Fixed Length
You are given an array of queries and a positive integer intLength. For each query, you need to find the query-th smallest palindrome of length intLength. A palindrome is a number that reads the same backward and forward, and it cannot have leading zeros. If no such palindrome exists for a query, return -1.
Leetcode 2221: Find Triangular Sum of an Array
You are given a 0-indexed integer array nums, where each element is a digit between 0 and 9. The triangular sum of nums is computed by repeatedly reducing the array by replacing each element with the sum of two consecutive elements, modulo 10. This process continues until only one element remains, which is the triangular sum. Your task is to return the triangular sum of the array.
Leetcode 2225: Find Players With Zero or One Losses
You are given an array matches where each element matches[i] = [winneri, loseri] indicates that player winneri defeated player loseri in a match. Your task is to return a list answer of size 2 where:
answer[0]contains the list of players who have never lost a match.answer[1]contains the list of players who have lost exactly one match.
The players in both lists should be sorted in increasing order.