VeroniqueVasileva

Untitled

Jan 9th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const tries = +gets();
  2.  
  3. for (let i = 0; i < tries; i++) {
  4.     let array = gets().split(',').map(e => +e);
  5.  
  6.     let isArraySorted = true;
  7.  
  8.     for (let j = 0; j < array.length - 1; j++) {
  9.         if (array[j] > array[j + 1]) {
  10.             isArraySorted = false;
  11.             break;
  12.         }
  13.     }
  14.  
  15.     print(isArraySorted);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment