Implement a function named calculate_rebate that computes the amount to be rebated by an insurance company based on two parameters: the maximum rebatable amount and the repair cost. The function should return the lesser of the two values, ensuring that the rebate does not exceed the repair cost.
Functionality Requirements
The function should take two integer parameters:
X: The maximum rebatable amount in lakhs.
Y: The amount required for repairing the damage in lakhs.
The function should return an integer that represents:
The rebate amount, which is the smaller value between X and Y.
Input/Output Requirements
Input:
X (int): A non-negative integer representing the maximum rebatable amount (in lakhs).
Y (int): A non-negative integer representing the repair cost (in lakhs).
Output:
An integer that is the amount to be rebated by the insurance company.
Example Cases
If X is 10 and Y is 5, the function should return 5.
If X is 3 and Y is 8, the function should return 3.
Implementation Location
The solution must be written in a file called /app/solution.py.