Implement a function that determines the last position of a "laddu" based on a given integer input. The function will compute the largest power of 2 that is less than or equal to the input number ( K ) and return that value. If ( K ) itself is a power of 2, the function should return ( K ).
Requirements:
Function Signature:
Implement the function as follows:
python
def find_last_laddu_position(K: int) -> int:
pass
Input:
A single integer ( K ) (where ( K \geq 1 )) representing the total number of laddus.
Output:
The function should return an integer which is the last position of the laddu. It should be the largest power of 2 that is less than or equal to ( K ).
Example Cases:
Input: 1, Output: 1
Input: 5, Output: 4
Input: 8, Output: 8
Input: 10, Output: 8
Implementation Notes:
Ensure that the function handles edge cases such as when ( K ) is 1 or a power of 2.
The solution must be implemented in a file called /app/solution.py.
Task Completion:
After writing the code, ensure that it is tested with various inputs to validate its correctness.