Problem Statement:-
Write a function that takes an array of numbers as an argument.
The function should check if the array is sorted and in which order and return one of the 3 options below.
"yes, ascending"
"yes, descending"
"no"
console.log(isSortedAndHow([3, 6, 9]));
// "yes, ascending"
console.log(isSortedAndHow([30, 25, 5, -5]));
// "yes, descending"
console.log(isSortedAndHow([28, 20, 15, 18]));
// "no"
#dsa #algorithm #javascript #python #java #frontend #webdevelopment #motivation #coding #codinglife