@anonymous/

JuvenileSardonicLiger

Ruby

No description

fork
loading
Files
  • main.rb
main.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
a=[1,2,3,4]
b=[2,4,5,2]
c=[5,4,4,2,4]

class Array
  def isSorted?
    permutations = permutation.to_a
    self == permutations.max || self == permutations.min
  end
end

p a.isSorted?
p b.isSorted?
p c.isSorted?
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]