check-if-array-is-sorted-and-rotated

Given an array nums, return true if the array is sorted and rotated, and false otherwise.

Ada AI

I want to discuss a solution

Help me solve this

Give more examples

What's wrong with my code?

How to use 'for loop' in javascript?