Suki's Muddy Pawprints
Suki, a black curly-coated dog with a grey beard and white paws, is walking across a floor, leaving muddy paw prints at each step. She starts at position (0, 0) and follows a sequence of directional moves.
Given her sequence of moves, count how many unique cells she visits (including her starting position) and determine whether she ever revisits a cell.
Input
The first line contains n (1 ≤ n ≤ 100,000), the number of moves Suki makes.
The second line contains a string of n characters, where each character is one of: U (up), D (down), L (left), or R (right).
Output
Print two lines:
- The count of unique cells visited.
Yesif Suki revisits any cell, orNoif she only visits each cell at most once.
Notes
- Suki starts at position
(0, 0), which counts as one visited cell. - Coordinates are in the plane: up increases y, down decreases y, left decreases x, right increases x.
- There are no bounds on the floor size; Suki can walk as far as needed.