7 kyu

Sorted? yes? no? how?

1,443 of 21,990janitormeir

Description:

Complete the method which accepts an array of integers, and returns one of the following:

  • "yes, ascending" - if the numbers in the array are sorted in an ascending order
  • "yes, descending" - if the numbers in the array are sorted in a descending order
  • "no" - otherwise

The order does not have to be strict: a sorted array can contain consecutive duplicates, e.g. [1, 1, 2, 3] is sorted in ascending order.

It is guaranteed that there will always be a unique valid answer. More precisely:

  • there will be no arrays with less than 2 elements
  • there will be no arrays where all elements are equal
Arrays
Sorting
Fundamentals

Stats:

CreatedOct 21, 2016
PublishedOct 21, 2016
Warriors Trained39181
Total Skips5143
Total Code Submissions92534
Total Times Completed21990
JavaScript Completions6378
Java Completions2472
C# Completions864
Python Completions6737
Ruby Completions848
C Completions1443
C++ Completions2408
TypeScript Completions659
Haskell Completions376
Clojure Completions316
Total Stars376
% of votes with a positive feedback rating88% of 2659
Total "Very Satisfied" Votes2116
Total "Somewhat Satisfied" Votes469
Total "Not Satisfied" Votes74
Total Rank Assessments8
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • janitormeir Avatar
  • raulbc777 Avatar
  • suic Avatar
  • anter69 Avatar
  • Chrono79 Avatar
  • kazk Avatar
  • user5036852 Avatar
  • lilsweetcaligula Avatar
  • Blind4Basics Avatar
  • Voile Avatar
  • hobovsky Avatar
  • trashy_incel Avatar
  • user8436785 Avatar
Ad