A loaded question is something like 'Have you stopped swearing?' in which both yes and no answers mean that I have swore, meaning it is impossible to answer the question if I haven't swore.
However, the constructed language Lojban has a word na'i, which means there is something wrong with what you just said.
Your input should be a list of newline-seperated strings containing the following tokens:
start
followed by any integer (e.g.-1
,0
,1
)stop
+ integerhaveYouStopped
+ integer
You can assume that each stop
n is followed by the corresponding start
n.
Then for each haveYouStopped
n in the code:
- Print
Yes, I have.
+ a newline if the laststop
n occurs before the laststart
n - Print
No, I have not.
+ a newline if the laststop
n occures after the laststart
n, or at least onestart
n but nostop
n is found in the previous line - Print
.i na'i
+ a newline if nostart
n occurs in the previous lines.
The last newline is optional.
Examples:
start 1
stop 1
haveYouStopped 1
Output: Yes, I have.
start 1
haveYouStopped 1
Output: No, I haven't.
haveYouStopped 1
Output: .i na'i
All code is counted in UTF-8 bytes. Codepoints outside the UTF-8 range are not allowed. Use any language, shortest code wins. Also, no external sources are allowed.
n
other than 1, testcases with multiple different n... \$\endgroup\$No, I have not.
, but in your test case the output isNo, I haven't.
. So should it behave not
, orhaven't
, or can we choose either? \$\endgroup\$