摘要:
问题: 求给定数组的对称轴index。(其左边元素之和=右边元素之和) 若不存在则返回-1,若存在多个,返回最左边的对称轴。 Example 1: Input: nums = [1, 7, 3, 6, 5, 6] Output: 3 Explanation: The sum of the numbe 阅读全文
摘要:
问题: 给定两个数组,求两个数组中最长公共子数组的长度。 Example 1: Input: A: [1,2,3,2,1] B: [3,2,1,4,7] Output: 3 Explanation: The repeated subarray with maximum length is [3, 2 阅读全文
摘要:
问题: 求给定数组的连续子数组个数,使得子数组之乘积,小于给定值 k Example 1: Input: nums = [10, 5, 2, 6], k = 100 Output: 8 Explanation: The 8 subarrays that have product less than 阅读全文
摘要:
问题: 给定一个非负整数,求只交换一次某两位的数字,使得值最大,求该最大值。 Example 1: Input: 2736 Output: 7236 Explanation: Swap the number 2 and the number 7. Example 2: Input: 9973 Out 阅读全文