Solving AdventJS 2023 Day 4 Challenge using JavaScript