Your question is Infinite Array Search. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
A Deutsche Telekom network-monitoring component exposes a sorted, conceptually infinite array of non-negative integers through indexed access. The array is strictly increasing, but its length is unknown to the caller. Find the index of a target value without scanning the entire array.
For this exercise, nums is a finite prefix used to simulate the infinite array. Accessing an index outside nums returns None, representing an unavailable position beyond the populated prefix.
Implement find_infinite_array(nums, target).
nums, a strictly increasing list of non-negative integers representing the accessible prefix, and target, a non-negative integer.target, or -1 if the target is not present.def find_infinite_array(nums, target):