Implement a function that determines the minimum number of operations required to sort a sequence of integer cards in descending order using a specific manipulation method.
Functionality Requirements
The function should take a list of integers representing the cards and their count as input.
It should return the minimum number of operations needed to sort the cards.
Input/Output Requirements
Input:
The function will receive two parameters:
a: a list of integers, where each integer represents a card value.
n: an integer representing the number of cards in the list a.
Output:
The function should return an integer representing the minimum number of operations required to sort the list in descending order.
Implementation Details
You are required to implement the function in a file named /app/solution.py.
The function signature must remain as:
python
def min_operations_to_sort_cards(a, n):
Example
python
# Example Input
a = [3, 1, 2, 4]
n = 4
# Example Output
result = min_operations_to_sort_cards(a, n) # result should be 1
Constraints
The list a will have at least 1 and at most 1000 elements.
Each integer in a will be within the range of -10^6 to 10^6.