LeetCode
Shortest Path with Alternating Colors
Click
here
for an explanation.