data/problems/244.yml
---
:id: 244
:name: Sliders
:url: https://projecteuler.net/problem=244
:content: "You probably know the game _Fifteen Puzzle_. Here, instead of numbered
tiles, we have seven red tiles and eight blue tiles.\n\nA move is denoted by the
uppercase initial of the direction (Left, Right, Up, Down) in which the tile is
slid, e.g. starting from configuration ( **S** ), by the sequence **LULUR** we reach
the configuration ( **E** ):\n\n| ( **S** ) | ![p244_start.gif]({{ images_dir }}/p244_start.gif)
| , ( **E** ) | ![p244_example.gif]({{ images_dir }}/p244_example.gif) |\n\nFor
each path, its checksum is calculated by (pseudocode):\n\nchecksum = 0 \nchecksum
= (checksum × 243 + <var>m</var><sub>1</sub>) mod 100 000 007 \nchecksum = (checksum
× 243 + <var>m</var><sub>2</sub>) mod 100 000 007 \n … \nchecksum
= (checksum × 243 + <var>m</var><sub><var>n</var></sub>) mod 100 000 007 \n\nwhere
<var>m</var><sub><var>k</var></sub> is the ASCII value of the <var>k</var><sup><var>th</var></sup>
letter in the move sequence and the ASCII values for the moves are:\n\n| **L** |
76 |\n| **R** | 82 |\n| **U** | 85 |\n| **D** | 68 |\n\nFor the sequence **LULUR**
given above, the checksum would be 19761398.\n\nNow, starting from configuration
( **S** ), find all shortest ways to reach configuration ( **T** ).\n\n| ( **S**
) | ![p244_start.gif]({{ images_dir }}/p244_start.gif) | , ( **T** ) | ![p244_target.gif]({{
images_dir }}/p244_target.gif) |\n\nWhat is the sum of all checksums for the paths
having the minimal length?\n\n"