[Fix #5637] Fix error for `Layout/SpaceInsideArrayLiteralBrackets` by koic · Pull Request #5658 · rubocop/rubocop

Fixes #5637. This PR reverts part of the optimized implementation by #5373. As a result, the performance will be that before the optimization, but it will fix the regression. Also, this PR adds a r...