Company: Adobe_12july
Difficulty: medium
Sequence of Balance Problem Description In the mystical land of Arrayland, there exists a legendary artifact known as the Sequence of Balance. This artifact is an array of numbers that holds great power, but over time, its harmony has been disturbed. The wise mathematician Eldrin, the guardian of Arrayland, has been given the task of restoring its lost balance. The artifact, represented as an array A of size N, contains a mixture of positive, negative, and zero values. To restore harmony, Eldrin must transform the array into a "good" sequence, which follows these sacred rules: The first element of the array must be positive. The last element of the array must be negative. There must exist an index K (1 ≤ K ≤ N-1) such that: All elements from index 1 to K (inclusive) must be negative. All elements from index K+1 to N (inclusive) must be positive. Eldrin has a special power—he can change any number in the array into any other integer in a single operation. However, the power