This sketch is setup for four tracks/switches and it shows lap counts up to 999. When the lap counts get over 99 then the display changes to a shorter/abbreviated display to allow all four tracks to have lap counts over 99 (three digits each).
It has some de-bounce logic as well so the car only produces a single lap count when going slowly over the track. It basically bumps the lap count when it first senses the pin going low and then ignores any other input on that pin for a brief time (800 milliseconds).
Since the display only needs to be updated when a lap count changes the display is only written to when any of the track counts change. This allows for fast processing and makes it very responsive. Between the de-bounce logic and this strategy for display updating the lap counts are extremely accurate (no counts are lost and nothing extra is given!).
LCDLapCounter.ino (Zip file)