Both "solution for" and "solution to" can be used, but they are used in slightly different contexts. "Solution for" is used when referring to a specific problem or situation that needs a resolution, while "solution to" is used when indicating the answer or resolution to a problem or situation. For example, "We need to find a solution for the traffic congestion" or "We found a solution to the math problem."