Computer Science, asked by shubhizajmani, 2 months ago


Three people are playing a game in which one person is selected first, the second person
gives the selected person a number N, and the third person also gives the selected person
a number M
The selected person has to maximize the number given by the second person in a way that:
1. (S)he can maximize the number given by the second person only by swapping the
adjacent two digits of the number
2. The number that the third person gives is the maximum number of swaps allowed.
Find the maximum number that the selected person can achieve.
Input Specification:
inputt: The number N

Answers

Answered by tanushpradhan82
1

Answer:

Three people are playing a game in which one person is selected first, the second person

gives the selected person a number N, and the third person also gives the selected person

a number M

The selected person has to maximize the number given by the second person in a way that:

1. (S)he can maximize the number given by the second person only by swapping the

adjacent two digits of the number

2. The number that the third person gives is the maximum number of swaps allowed.

Find the maximum number that the selected person can achieve.

Input Specification:

inputt: The number N

Explanation:

selected person a number N, and the third person also gives the ... the number given by the second person in a way or

"that" (and any subsequent words) was ignored because we limit queries to 32 words.

Search Results

Similar questions