| Problem statement | Source code | Tags: Brute force
Nothing to say here. Just parse the input and check the counts.
The left position check is password[ind_range[0] - 1] == char and the right position check is password[ind_range[1] - 1] == char. We want exactly one of them to be true, so we can use !=.