Algorithm on secrete key generation
-
Adam works in the in networking security cell. He wants to generate secret keys
following a pattern. The pattern consists of the characters X and Y.
where X means increasing and Y means decreasing. Help him devise an
algorithm to generate the secret key which is the minimum number encoded
following that pattern. Digits from 1-9 and digits can’t repeat.Sample Input: Sample Output:
X 12
YXYX 21435
YYXYYXXY 321654798 -
Adam works in the in networking security cell. He wants to generate secret keys
following a pattern. The pattern consists of the characters X and Y.
where X means increasing and Y means decreasing. Help him devise an
algorithm to generate the secret key which is the minimum number encoded
following that pattern. Digits from 1-9 and digits can’t repeat.Sample Input: Sample Output:
X 12
YXYX 21435
YYXYYXXY 321654798 -
Adam works in the in networking security cell. He wants to generate secret keys
following a pattern. The pattern consists of the characters X and Y.
where X means increasing and Y means decreasing. Help him devise an
algorithm to generate the secret key which is the minimum number encoded
following that pattern. Digits from 1-9 and digits can’t repeat.Sample Input: Sample Output:
X 12
YXYX 21435
YYXYYXXY 321654798We don't do your HomeWork. Advice try to solve the problem by habd, see how you build the solution. try to device a program that will follow the same processus. It is not so difficult.
Patrice “Everything should be made as simple as possible, but no simpler.” Albert Einstein