-= Puzzle 2: Lasering Walls =-
You arrive for your second day at BitFlop Laboratories, where your manager eagerly introduces the company's newest purchase.
A laser-powered cleaning robot.
What happens if someone accidentally walks in front of the laser while it's cleaning? you ask.
Your manager shushes you quickly, saying "Theres no need to worry about that!"
Apparently, a much more pressing concern is making sure the robot doesn't accidentally overheat parts of the wall by firing its laser at the same spot too many times!
The hallway it's cleaning consists of 100 wall segments, numbered from 1 to 100, with the robot starting in front of wall segment 1.
The robot follows a list of instructions (your puzzle input). Each instruction is a single character:
<: move one segment to the left.>: move one segment to the right.
The hallway loops around. Moving left from segment 1 takes the robot to 100, while moving right from 100 brings it back to 1.
After every movement, the robot fires its laser at the wall segment in front of it, increasing that segment's temperature by 1 degree.
For example:
><>><<>><<<>>>>><><><><><>>>>>
Initially, every wall segment has a temperature of 0:
0 0 0 0 0 0 0 0 0 0 0 0
1 2 3 4 5 6 7 8 9 10 .. 99 100
R
The first row represents the temperature of each wall segment, and the second row represents the wall segments themselves. The R represents the position of the robot.
The first instruction is >, the robot moves right to segment 2 and fires its laser, heating up segment 2 by 1 degree:
0 1 0 0 0 0 0 0 0 0 0 0
1 2 3 4 5 6 7 8 9 10 .. 99 100
R
The next instruction <, moving the robot left to segment 1 and after firing the laser, segment 1 is heated up by 1 degree:
1 1 0 0 0 0 0 0 0 0 0 0
1 2 3 4 5 6 7 8 9 10 .. 99 100
R
This continues for all the instructions, and after executing every instruction, the hallway looks like this:
4 6 3 6 6 1 1 1 1 0 0 1
1 2 3 4 5 6 7 8 9 10 .. 99 100
R
Your task is find the most heated up wall segment after the robot has executed all of its instructions, and multiply that segment's temperature by its segment number.
If multiple wall segments share the highest temperature, use the lowest wall segment number.
For the example above, the most heated up wall segment are segments 2, 4, and 5 with a temperature of 6 degrees, but we should use segment 2 because it has the lowest segment number.
This means the answer for the example is 6 * 2 = 12.
What is the hottest wall segment's temperature multiplied by its segment number after the robot has executed all of its instructions?