Before the prayer assembly begins, the students of different classes stand randomly in a single line. Often they become noisy . To maintain silence during the prayer assembly , the teacher tells them to stand in a particular sequence. The sequence is such that there are atleast AND students of other classes standing between the students of the same class. write an algorithm to output the final sequence in which the students will stand . If no such sequence is possible then output-1 . if more than one sequence is possible then output the lexicographically smallest string
Answers
Answered by
7
Answer:
hello everyone, I'm new here.
Similar questions