Daily challenge for 2026-07-27
573. Find Target Difference
You are given a sorted array of positive integers nums and a target difference diff. Determine if there exist two distinct indices in the array such that the difference between the elements at these indices is exactly diff.
Your solution should run in $O(N)$ time complexity using the two-pointer technique.
Example:
Input: nums = [1, 3, 8, 10, 15], diff = 5
Output: true (since 8 - 3 = 5)
Run this challenge interactively in Python or JavaScript when the app loads.