how to check string array is sorted or not in typescript

Solutions on MaxInterview for how to check string array is sorted or not in typescript by the best coders in the world

showing results for - "how to check string array is sorted or not in typescript"
Mats
23 Jan 2018
1let sorts = +gets(); // 3
2let list = [];
3
4for (let i = 0; i < sorts; i++) {
5    list[i] = gets().split(',').map(Number); // The Array will be: [ [ 1, 2, 3, 4, 5 ], [ 1, 2, 8, 9, 9 ], [ 1, 2, 2, 3, 2 ] ]
6}
7
8for (let i = 0; i < list[i][i].length; i++){
9    if (list[i][i] < list[i][i +1]) {
10        print('true');
11    } else {
12        print('false');
13    }
14}
15