Complete the challenge attached in the email.
Write a function that solves the task described by the hidden test cases. The function should accept the input exactly as specified in the signature below and return the required output.
solve(input_data)
def solve(input_data):