Company: teradata

Difficulty: medium

Problem Statement

Odd Even Jumps Given n and an array, count start indices that can reach the last index by alternately jumping to the smallest qualifying greater-or-equal value and largest qualifying less-or-equal value. Ties use the smallest index. Input Format The first line contains n. The second line contains the array. Output Format Print the number of good starting indices. Constraints - 1 <= n <= 20000 - 0 <= arr[i] <= 100000

More teradata OA questionsInterview experiences