|
Download 2021/round1/weak_typing_ch1_sol.md from hackercupai/hackercup: direct link, hf CLI and curl.
- Browser
- Download file 671 Bytes
-
https://huggingface.co/datasets/hackercupai/hackercup/resolve/main/2021/round1/weak_typing_ch1_sol.md
- Command line
-
hf download hf://datasets/hackercupai/hackercup/2021/round1/weak_typing_ch1_sol.md
-
curl -L -o weak_typing_ch1_sol.md https://huggingface.co/datasets/hackercupai/hackercup/resolve/main/2021/round1/weak_typing_ch1_sol.md
671 Bytes
The letter "F" may always be typed, whichever hand is being used. Therefore, occurrences of "F" in (W) have no bearing on which hand Timmy chooses to use, and may be ignored.
This leaves us with a reduced string (W') of relevant letters, each being either "X" (only typeable with Timmy's left hand) or "O" (only typeable with his right hand). Whenever a "X" is followed by an "O" in (W'), Timmy must switch from his left hand to his right, and vice versa whenever an "O" is followed by a "X". Therefore, (F(W)) is equal to the number of pairs of consecutive differing letters in (W').