Official
B - Permutation Check Editorial by en_translator
One can check if each of as an element of to solve in a total of time time.
Otherwise, one can sort the elements of in the increasing order and check if are in this order to solve in a total of time.
posted:
last update: