1classSolution {2publicintminPairSum(int[] nums) {3Arrays.sort(nums);4intmax =Integer.MIN_VALUE;5intres =Integer.MAX_VALUE;6intleft = 0;7intright = nums.length - 1;8while(left <right) {9inti =nums[left];10intj =nums[right];11max = Math.max(max, i +j);12left++;13right--;...
908-middle-of-the-linked-list 943-sum-of-subarray-minimums 966-binary-subarrays-with-sum 97-interleaving-string README.md stats.jsonBreadcrumbs Data-Structures-Leetcode /2473-max-sum-of-a-pair-with-equal-sum-of-digits / README.mdLatest...
【python-双指针】pair with target sum 找不到该题对应leetcode的哪一题。。。 问题描述: 给定一个有序数组和一个目标和,在数组中找到一对和等于给定目标的数组,有就返回下标,没有就返回[-1,-1]。 例如: s=[1,2,3,4,5,6,7,8],k=14,返回[5,7],也就是下标为5和下标为7的和为14:6+8=14。
// URL: https://codeforces.com/contest/1536/problem/C // Memory Limit: 256 MB // Time Limit: 2000 ms // // Powered by CP Editor (https://) #include<bits/stdc++.h> #defineILinline #definexfirst #defineysecond typedeflonglongll; usingnamespacestd; constintN=500010; intsum[N]; m...