leetcode.cn 2026-04-19
🟡1855.maximum-distance-between-a-pair-of-values
🏷️ Tags
#array #two_pointers #binary_search
🟡1855.maximum-distance-between-a-pair-of-values
🏷️ Tags
#array #two_pointers #binary_search
Telegraph
maximum-distance-between-a-pair-of-values
给你两个 非递增 的整数数组 nums1 和 nums2 ,数组下标均 从 0 开始 计数。 下标对 (i, j) 中 0 <= i < nums1.length 且 0 <= j < nums2.length 。如果该下标对同时满足 i <= j 且 nums1[i] <= nums2[j] ,则称之为 有效 下标对,该下标对的 距离 为 j - i 。 返回所有 有效 下标对 (i, j) 中的 最大距离 。如果不存在有效下标对,返回 0 。 一个数组 arr ,如果每个…
leetcode.com 2026-04-19
🟡1855.maximum-distance-between-a-pair-of-values
🏷️ Tags
#array #two_pointers #binary_search
🟡1855.maximum-distance-between-a-pair-of-values
🏷️ Tags
#array #two_pointers #binary_search
Telegraph
maximum-distance-between-a-pair-of-values
You are given two non-increasing 0-indexed integer arrays nums1 and nums2. A pair of indices (i, j), where 0 <= i < nums1.length and 0 <= j < nums2.length, is valid if both i <= j and nums1[i] <= nums2[j]. The distance of the pair is j - i.…