# -*- coding: utf-8 -*-
"""
Created on Mon Apr 20 23:34:40 2020

@author: Di Wang
"""

class Solution:
    def isMonotonic(self, A):
        F=sorted(A)
        B=F[::-1]
        return (A==F or A==B)


#one line
def isMonotonic(self, A):
    return A==sorted(A) or A==sorted(A)[::-1]
29af92010bcf5d0a42157b6c1c507ae86b042dd7
<mask token>

<mask token>


class Solution:
    <mask token>


<mask token>

<mask token>


class Solution:

    def isMonotonic(self, A):
        F = sorted(A)
        B = F[::-1]
        return A == F or A == B


<mask token>

<mask token>


class Solution:

    def isMonotonic(self, A):
        F = sorted(A)
        B = F[::-1]
        return A == F or A == B


def isMonotonic(self, A):
    return A == sorted(A) or A == sorted(A)[::-1]

# -*- coding: utf-8 -*-
"""
Created on Mon Apr 20 23:34:40 2020

@author: Di Wang
"""

class Solution:
    def isMonotonic(self, A):
        F=sorted(A)
        B=F[::-1]
        return (A==F or A==B)


#one line
def isMonotonic(self, A):
    return A==sorted(A) or A==sorted(A)[::-1]