Implement a function named count_jerry_wins that counts the number of wins Jerry has based on a given number of total scores (denoted as ts). The function should follow these rules:
If ts is an odd number, Jerry's wins are calculated as the integer division of ts by 2.
If ts is an even number, Jerry's wins are calculated by repeatedly dividing ts by 2 until it becomes odd. The final count of wins is then calculated as the integer division of this odd ts by 2.
Input Requirements:
The function takes one argument:
ts (int): A non-negative integer representing the total scores.
Output Requirements:
The function should return:
An integer representing the count of Jerry's wins based on the above rules.
Example:
count_jerry_wins(15) should return 7 (since 15 is odd, 15 // 2 = 7).
count_jerry_wins(8) should return 2 (8 is even, divide by 2 to get 4, then divide by 2 to get 2, so 2 // 2 = 1).
Implementation:
Write the solution in a file located at /app/solution.py.
Ensure to include proper function definition as described above.