• Given a state aState of the tic-tac-toe game, list all the empty slots and returns the array of their indices.

    Parameters

    • aState: string[]

      a state of the game

    Returns number[]

    • an array of indices
    stateEmptySlots([ 'x', ' ', 'o', 'x', 'o', ' ', 'x', ' ', ' ' ]);
    // -> [ 1, 5, 7, 8 ]