Implement a function valueEqualToIndex(arr, n) which identifies all the elements in a given list that are equal to their respective 1-based index positions.
Functionality:
The function should iterate over the array arr and check for each index i if the value at that index is equal to i + 1.
If the condition is met, the value i + 1 should be collected into a result list.
The function should return this result list containing the values that meet the condition.
Input/Output Requirements:
Input:
arr: A list of integers.
n: An integer representing the size of the list arr (0 ≤ n ≤ 1000).
Output:
A list of integers where each integer is an index (1-based) where the value equals the index.
Example:
Input: arr = [1, 2, 3, 4, 5], n = 5
Output: [1, 2, 3, 4, 5]
Input: arr = [2, 3, 1, 5, 4], n = 5
Output: [3]
Implementation Requirement:
The solution must be written in a file called /app/solution.py.