countLightsAfterCommands :: String -> Int
countLightsAfterCommands s = runST $ do
  let cs = parseCommands s
  grid <- createGrid
  forM_ cs $ \c -> performCommand grid c
  lightsOn grid
countLightsAfterCommands :: String -> Int
countLightsAfterCommands s = runST $ do
  let cs = parseCommands s
  grid <- createGrid
  forM_ cs $ \c -> performCommand grid c
  lightsOn grid
countLightsAfterCommands s = runST $ do
  let cs = parseCommands s
  grid <- createGrid
  forM_ cs $ \c -> performCommand grid c
  lightsOn grid