← ALL NOTES
String

2211. Count Collisions on a Road

A string directions of 'L', 'R', 'S' — cars moving left, right, or stationary. Colliding cars stop. Each collision counts: R+L gives 2 (both cars), a stationary car hit by a mover gives 1. Return the…

Loading…