Error in input/expected output


#1

there is an issue in the question. The question states that only one key exists for one lock but in this input (in the picture), there are 2 keys and no locks. Maybe one of the keys is supposed to be lock but still the answer should not be -1 as all keys can be visited individually.

pic:


#2

Same problem, please correct the input or problem statement