In the last for loop, the correct condition will be i < topo.size()
@harshitagrahari92418 ай бұрын
Good explanation
@AgrawalAshutosh8 ай бұрын
And if the last element of the digit is greater than the current v[i] , then the array will not be sorted and hence we will print "No". The digit vector stores the digit of the element in the array. So for eg if A = {12, 5 ,3} Digit vector={ 1,2,5,3}