# [C# (Visual C# Interactive Compiler)], 120 bytes <!-- language-all: lang-cs --> s=>s[0]==s[^1]&!s[..^1].Where((c,i)=>i<s.IndexOf(s.Max())?c>=s[i+1]:i<s.LastIndexOf(s.Max())?s.Max()!=c:c<=s[i+1]).Any() [Try it online!][TIO-k6dhgm27] [C# (Visual C# Interactive Compiler)]: http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc [TIO-k6dhgm27]: https://tio.run/##fc7NCoJAFAXgfU9hLWKGasqfGZ1yjDZBUNQiaCEGNmkNhIFXwZ7eDCKSmHYHvnO4V8JIgqqXZSZ9KHKVXYan@/0WGKkhahABhJNICAiPZtTvQkhIE8jhmuQJQnKosAiUD2SVnZNqmyIgm7hCGM9l0GzUwIymL17HUPxU3qEr5FT67zYmi@yBcD3rdHbNLwVKUc@0bMvsYTwzxmNjn5fF9dFC@w9zrhNbB5btUOZybv05@bFlfIMvcl3P40yDzUw7dChljFJHw5Q5tEX1Ew "C# (Visual C# Interactive Compiler) – Try It Online" Here is an overview of how this works... 1. Input is in the form of a `string` 2. Find the largest digit 3. Ensure the first and last digits are the same 4. Ensure digits after the last occurrence of the largest digit are decreasing 5. Ensure digits between the first and last occurrence of the largest digit are equal to the largest digit 6. Ensure digits before the first occurrence of the largest digit are increasing