In python please! You are given an array of non-negative integers numbers. You are allowed to choose any number from thi
Posted: Sun May 15, 2022 11:45 am
In python please!
You are given an array of non-negative
integers numbers. You are allowed to choose
any number from this array and swap any two digits in it. If after
the swap operation the number contains leading zeros, they can be
omitted and not considered (eg: 010 will
be considered just 10).
Your task is to check whether it is possible to apply the swap
operation at most once, so that the elements
of the resulting array are strictly increasing.
Example
You are given an array of non-negative
integers numbers. You are allowed to choose
any number from this array and swap any two digits in it. If after
the swap operation the number contains leading zeros, they can be
omitted and not considered (eg: 010 will
be considered just 10).
Your task is to check whether it is possible to apply the swap
operation at most once, so that the elements
of the resulting array are strictly increasing.
Example