Implement a function that counts the number of smaller elements to the right of each element in a given list of integers. Your implementation should match the provided function signature.
Input/Output Requirements
Input:
A list of integers arr (1 <= len(arr) <= 1000, -10^6 <= arr[i] <= 10^6).
Output:
A list of integers where each element at index i represents the number of elements in the sublist arr[i+1:] that are smaller than arr[i].
Implementation
Please write the solution in a file named /app/solution.py following the given function signature:
python
def count_smaller_elements_to_right(arr):
# Implementation goes here
Ensure that your code is well-structured, and include any necessary comments to clarify your logic.