in-out? out-in? stairs? reverse?
InterviewTime limit1sMemory limit1024 MB
Given a string that is a permutation of the eight keys a s d f j k l ;, decide whether it is in-out, out-in, stairs, reverse, or none of these.
- Level
Easy2 of 10
- Topics
- Implementation, String
- Solved
- No attempts yet
Problem
Players of rhythm games at Daesogo use different typing styles.
The styles are in-out, out-in, stairs, and reverse.
One day, a Daesogo friend turned on a computer and left some characters in Notepad.
asdfjkl;
changwook987, who often plays rhythm games, noticed that the friend who wrote in Notepad used the stairs style.
changwook987 became interested in the typing styles of friends, so asked another friend to type in Notepad using that friend's own style.
Given the characters that the other friend typed, determine which style was used.
Input
A string of length 8 is given. Each of the characters a, s, d, f, j, k, l, and ; appears exactly once in .
Output
If the input is in-out, print in-out.
If the input is out-in, print out-in.
If the input is stairs, print stairs.
If the input is reverse, print reverse.
If the input is none of these four styles, print molu.