fork download
  1. @(x)any(all([x;flip(x)]'==sort(x)',1))
  2.  
  3. ans('ABCDC')
Success #stdin #stdout 0.22s 103360KB
stdin
Standard input is empty
stdout
ans =

@(x) any (all ([x; flip(x)]' == sort (x)', 1))

ans = 0