Sponsored
Use these hints if you're stuck. Try solving on your own first.
Think about all valid strings of length n.
Try to count the mismatched positions with each valid string of length n.
Solve with full IDE support and test cases