Update exam/packet.tex
This commit is contained in:
@@ -145,15 +145,16 @@ Output:
|
||||
% ========================= Problem 6 =========================
|
||||
\problem{Problem 6(.7): Sequencing}
|
||||
\textit{Difficulty: Easy}
|
||||
\begin{itemize}
|
||||
You are given a string S composed of only the characters ‘6', ‘7’, ‘A', ‘B', and ‘\#' (without the quotation marks). This string is processed from left to right, and you must maintain a sequence of chracters that changes according to these rules:
|
||||
|
||||
You are given a string S composed of only the characters 6, 7, A, B, and \# (without the quotation marks). This string is processed from left to right, and you must maintain a sequence of chracters that changes according to these rules:
|
||||
\begin{itemize}
|
||||
\item 6 - add a 6 to the end of the sequence
|
||||
\item 7 - if the sequence is non-empty and its last chracter is ‘6', remove that last ‘6', otherwise, add ‘7' to the end of the sequence
|
||||
\item 7 - if the sequence's last chracter is 6, remove that last 6, otherwise, add 7 to the end of the sequence
|
||||
\item A - reverse the sequence
|
||||
\item B - add a duplicate of the current sequence to the end of it
|
||||
\item \# - clear the sequence
|
||||
\end{itemize}
|
||||
|
||||
\inputformat
|
||||
\begin{itemize}
|
||||
\item The first line consists of the string S. The string consists only of the characters 6, 7, A, B, and \#.
|
||||
|
||||
Reference in New Issue
Block a user