1679. Max Number of K-Sum Pairs
Max Number of K-Sum Pairs - LeetCode 한 연산에서 배열에서 합이 k가 되는 두 숫자를 선택하고, 해당 숫자들을 배열에서 제거할 수 있습니다. 배열에서 수행할 수 있는 최대 연산 횟수를 반환하세요. 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. Example 1: Input: nums = [1,2,3,4], k =..
LeetCode
2023. 11. 2. 00:25