[Question]
  [
A pleasing number (according to this definition) is a number that can be passed through the following process (let's use `41802000` as an example):
* Separate the trailing identical numbers (`41802000 => [41802, 000]`)
* Sort the first half of the digits and take the maximum (`[41802, 000] => [8, 000]`)
* Take the length of the final element. Call the resultant elements *A* and *B* (`[8, 000] => A=8, B=3`)
* Is NB = A for any integer `N`? (`True` in this example; 23 = 8)
If the input results in `True` from the following process, it is considered pleasing.
Your task is to take an integer `x`, and output whether `x` is a pleasing number. You can output any two distinct values for truthy and falsey, but please state what you're using in your answer. `x` is guaranteed to have at least two distinct digits (e.g. `111` is an invalid input). As with most challenges, you may take `x` as a string, or a list of digits.
This is a [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so shortest code in *bytes* wins.
## Test cases
```
          Input          Output
       41802000               1
            100               1
      123456788               0
      451111111               0
234543454545444               0
             12               1
       41902000               0
          92599               1
```
  
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), 36 bytes
```
{(⊢≡⌊)(⌈/⍎¨⍵/⍨~o)*÷≢⍵/⍨o←⌽⌊\1,2=/⌽⍵}
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///P@1R24RqjUddix51LnzU06Wp8ainQ/9Rb9@hFY96twIZK@ryNbUOb3/UuQjKzwdqeNSzF6g2xlDHyFYfxO7dWgs0SeFR71QFE0MLAyMDAwMuCNcQwTIyNjE1M7ewgPJNTA0hAMhXB8mZgDAImpiow/UAAA "APL (Dyalog Unicode) – Try It Online")
**How?**
*Almost a poem.*
`⌽⍵` - reverse the input once,
`1,2=/` - get the differences list.
`⌊\` - keep only the first group of ones,
`⌽` - and flip it over to complete.
---
`o←` - assign to `o`,
`~o` - switch ones and zero(s),
`⍵/⍨` - filter the input with it,
`⍎¨` - turn the result into list of each digit,
* `⌈/` - and get the maximum. (that's A)
---
`⍵/⍨o` - filter the input with `o` unalt(ered),
`≢` - and take the length, that would be B.
`÷` - get one divided by this result,
`*` - and take A to that power thee.
---
`⊢≡⌊` - integer?
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 11 bytes
```
γRćgUZXzm.ï
```
[Try it online!](https://tio.run/##MzBNTDJM/f//3OagI@3poVERVbl6h9f//29iaGFgZGBgAAA "05AB1E – Try It Online")
## Explanation
```
γRćgUZXzm.ï ~ Full program.
γ           ~ Split into runs of digits.
 R          ~ Reverse.
  ć         ~ Push a[1:], a[0] to the stack.
   g        ~ Length (of a[0]).
    U       ~ Assign this to the integer variable X.
     ZX     ~ Get the maximum, without popping, and push X.
       zm   ~ A1/B.
         .ï ~ Is it an integer?
```
[Emigna](https://codegolf.stackexchange.com/users/47066/emigna) saved 1 byte.
Relies on the fact that if **A** is a positive integer **N** raised to the power of **B**, then **N=A1/B**, hence it must be an integer.
[Answer]
# [Haskell](https://www.haskell.org/), ~~85~~ ~~75~~ ~~72~~ 71 bytes
***Edit**: -10 bytes by taking a list of digits instead of a string. Thanks to [WhatToDo](https://codegolf.stackexchange.com/users/76292/whattodo) for pointing out that this is allowed. -3 bytes thanks to [Ourous' solution in Clean](https://codegolf.stackexchange.com/a/150964/56433). -1 byte thanks to [user28667](https://codegolf.stackexchange.com/users/75762/user28667).*
```
f s|(b,a)<-span(==last s)$reverse s=or[n^length b==maximum a|n<-[1..9]]
```
[Try it online!](https://tio.run/##dU5RasMwDP3PKfSxjwSUYLtK60B9hJ3AZOCCu4bGXoizMVh39sxZlrJ2y3sIIT09SScTzrZtx/EI4ZIe0GT7PHTGp0q1JgwQsofevtk@WAjqpdf@qbX@eTjBQSln3hv36sBc/D7XvCiquh6daTwocKZ7hLTrGz9AAccMtCbkKJGhiBFZo@bXLHCDhCVucRdnZOxNFf/N2Fum6JqXiJz3fDs5Vnd3pp118pEnMIO4ZIIxBrfgyU21qnOxoXK7k/JOZz86lXzGH30y0hQTiVb8yzmx9h/x6r//WZJ/jl8 "Haskell – Try It Online") Takes input as a list of digits. Example usage: `f [4,1,8,0,2,0,0,0]` yields `True`.
### Explanation:
Given an input `s=[4,1,8,0,2,0,0,0]`, we `reverse` the list and separate the leading elements with `span(==last s)`: `([0,0,0],[2,0,8,1,4])`.
The pattern matching on `(b,a)` yields `b=[0,0,0]` and `a=[2,0,8,1,4]`.
The list comprehension `or[n^length b==maximum a|n<-[1..a]]` checks whether any integer `n` in the range from `1` to `9` satisfies `n^length b==maximum a`, that is `n^3=8`.
[Answer]
# [Haskell](https://www.haskell.org/), ~~104~~ 89 bytes
@Laikoni found a [shorter solution](https://codegolf.stackexchange.com/a/150960/24877), but this is the best I could do. Thanks @Laikoni for letting me know that we can also accept lists of digits as input. 
```
import Data.List
(g.length.last<*>maximum.concat.init).group
g b a=any(==a)$(^b)<$>[1..a]
```
### Explanation:
![](https://i.stack.imgur.com/tHLV7.jpg)
[Try it online!](https://tio.run/##fZHNToQwEMfvPMUcOLQGGopdRbP05NE3IJgMaxca@Qp0oz49UlhAV9dpOpl2fvOfaVpg/6bKchh01TadgSc0yJ51b5xjTHJWqjo3BSuxN/sbWeGHrk4VOzT1AQ3TtTaU5V1zap0cMsAY608Sx0hd8pLRvSsTzhimQ4W6hhjaTtcGXDjCmAIgpFP4yshjklqWsr5o3umUSwSPgjAIAo/bHd6K3d19FHlix2fz7JWw2y4hRsYT/GGqSR3fh9kWGfhpfCPm8z/E2vyCCFZiHeoP4mLMqxpL2/D6pMvzfmlYRIEvAa3LrCPKl0iXKKMAIzN@oEXJjJ2zU923eGHdmd10piq1lapzsxGSMqbDFw "Haskell – Try It Online")
[Answer]
# [R](https://www.r-project.org/), 80 bytes
```
function(x)any((0:(m=max((d=rle(rev(utf8ToInt(c(x,''))-48)))$v[-1])))^d$l[1]==m)
```
[Try it online!](https://tio.run/##LYzBCoMwEETv/Q7BWaiQ2LWNhXxA772JBVEDBRNBoqRfnzbVXYbZYR67RKOjWV3v37NDoM59AHGH1bYLwKCXacQybli9Uc/54Tx6hHOeExWsiCjbmkK2v@M1ZFMjW60tRQOWSpRCCDoZyMPKC1fXm1IpcCX3SSEVnJSWeYf/lKyPL/EL "R – Try It Online")
Uses `utf8ToInt - 48` to split the number into digits. This throws a warning from the conversion to a string.
Using rle get the count of the trailing digits and the max value of the first digits. Return true if the any of the range 0 to max value to the power of trailing count equals max value.
I think there are further golfing opportunities, but that can wait until tomorrow.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 11 bytes
```
ŒgµṪL9*€fṀL
```
Takes input as a list of digits.
[Try it online!](https://tio.run/##y0rNyan8///opPRDWx/uXOVjqfWoaU3aw50NPv@P7nE53A7kqbj//29iaGFgZGBgoKNgCCaMjE1MzcwtLHQUTEwNIUBHASRoAsIgaGICUgaUN7QE6wQA "Jelly – Try It Online")
### How it works
```
ŒgµṪL9*€fṀL  Main link. Argument: D (digit array)
Œg           Group runs of digits, yielding a run array R.
  µ          Begin a new chain with argument D.
   Ṫ         Tail; remove and yield the last element of D.
    L        Take the length. Let's call it b.
     9*€     Compute [1**b, ..., 9**b].
         Ṁ   Take the maximum run in R, yileding [a, ..., a].
        f    Filter, yielding either [a] (if a = n**b for some n) or [].
          L  Take the length. 
```
[Answer]
# R, 66 bytes
This answer is more or less a medley of [MickyT](https://codegolf.stackexchange.com/a/150989/6741) and [NofP](https://codegolf.stackexchange.com/a/150980/6741)'s answers, and on their request, here it is:
```
function(x,R=rle(rev(utf8ToInt(x)-48)))!max(R$v[-1])^(1/R$l[1])%%1
```
It takes x as a string.
```
> f=function(x,R=rle(rev(utf8ToInt(x)-48)))!max(R$v[-1])^(1/R$l[1])%%1
> f("41802000")
[1] TRUE
> f("100")
[1] TRUE
> f("123456788")
[1] FALSE
> f("451111111")
[1] FALSE
> f("234543454545444")
[1] FALSE
> f("12")
[1] TRUE
> f("41902000")
[1] FALSE
```
[Answer]
# JavaScript (ES7), 66 bytes
Takes input as either a string or an array of characters. Returns a boolean.
```
f=([c,...s],m)=>s.some(n=>n-c)?f(s,c<m?m:c):!(m**(1/-~s.length)%1)
```
### Test cases
```
f=([c,...s],m)=>s.some(n=>n-c)?f(s,c<m?m:c):!(m**(1/-~s.length)%1)
console.log(f(       '41802000')) // 1
console.log(f(            '100')) // 1
console.log(f(      '123456788')) // 0
console.log(f(      '451111111')) // 0
console.log(f('234543454545444')) // 0
console.log(f(             '12')) // 1
```
[Answer]
# [Clean](https://clean.cs.ru.nl), ~~130~~ ~~128~~ ~~118~~ 93 bytes
```
import StdEnv
@l#(b,a)=span((==)(last l))(reverse l)
=or[n^length b==last(sort a)\\n<-[0..9]]
```
Defines the function `@`, taking a list of integer digits.
[Try it online!](https://tio.run/##TZDBasMwDIbveQqRXhxo2qRLt3TU0MN2KOyWY5KBG3upwZFDrBb28svsZofZSPow/y8Jd0YJnAcrb0bBIDTOehjtRFCRfMd7dDIrdlmLhLtRIGOcJ8wIR2CShE3qrianPEfcTjV@GoU9XeHCedAwF/qIpGnwmNbZZnNo27kiMVG00jjeyAGHOi7yMttlWRav43zJu6di//xSlp6Lfb4cz@G5CBFuUTyUQZIfFn8bbbfQWfRLEZAFqXvtF9WO3P@BNdkzEjCyFU0ae5AJNA1IOKavoNvA2jMsjkdTuioEaUP14T0R9381wulPNP90X0b0bk7PH/PbN4pBd@4X "Clean – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), ~~95~~ 78 bytes
* Saved seventeen bytes thanks to [Rod](https://codegolf.stackexchange.com/users/47120/rod).
```
def f(s,i=~0):
	while s[i]==s[~0]:i-=1
	return int(max(s[:-~i]))**(1./~i)%1==0
```
[Try it online!](https://tio.run/##bY/BCoMwDIbP9imKMLAyXdPVzQl9hb2AeBBWsbC10jq2XfrqTpExh0vIJd@f/En36luj2TBcZIObyG2V8JQUKHi06iqxK1UlhCs9rQqVCECBlf3daqx0H93qZ@TKIvGqIiSOI0h3XpENCEGH2jlp@3FjyCGnjFIaEiwEBvQl8LfJ9jw7HPN8RnSBeAZzrNE0xKeakvO1ANjaisNpcdmP@mMPqLPjqzg8GzxjZTSW1hrr0nB4Aw "Python 2 – Try It Online")
[Answer]
# [R](https://www.r-project.org/), 93 bytes
```
function(x){n=nchar(x)
d=x%/%10^(n:1-1)%%10
i=max(which(d!=d[n]))
max(d[1:i])^(1/(n-i))%%1>0}
```
[Try it online!](https://tio.run/##NYtNCsIwEIX3uYWLwMyidKZGkEK8SGmhJIRk4SihYkA8e0wW8njw8X5yDbaGl7gjPQQKfsSKi3tuqLwtetRMG8jMA6NurJK97wXeMbkI/mT9Iiui6plfeE4rbsAjyJCw72/0rc@c5IAA09lcTHeXMe31bwxfaSIixPoD "R – Try It Online")
The code takes an integer as input and returns FALSE if the number is pleasing, and TRUE otherwise. 
[Answer]
# [Python 3](https://docs.python.org/3/), ~~88~~ 85 bytes
```
def f(n):p=n.rstrip(n[-1]);a=int(max(p));b=len(n)-len(p);return round(a**(1/b))**b==a
```
### Ungolfed:
```
def is_pleasing_number( n ):
    prefix = n.rstrip(n[-1])
    a = int(max(prefix))
    b = len(n) - len(prefix)
    return round(a ** (1 / b)) ** b == a
```
* The input argument is expected to be a digit string
* The output is either `True` or `False`.
* Similar to yet developed independently of [Halvard’s answer](/a/150947/68800) but uses floating point arithmetic in a way that doesn't suffer from rounding errors until `a ** (1 / b)` is off by at least 0.5 from b√a which requires a value above 253 (or whatever floating point radix and mantissa length Python happens to use, see `sys.float_info`).
* Can be modified trivially to still work with arbitrary number bases between 2 and 36.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~144~~ ~~126~~ 117 bytes
* Saved eighteen bytes thanks to [Dennis](https://codegolf.stackexchange.com/users/12012/dennis).
* Saved nine bytes thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat).
```
j,k,m;f(char*N){N+=j=strlen(N);k=~j;for(j=-1;m=N[j--]==N[j];);for(;k++<j;)m=fmax(N[k],m);j=!fmod(pow(m-48,1./~j),1);}
```
[Try it online!](https://tio.run/##jY9RTsMwDIaf4RSl0qSEJpCUDIqMr5ALjD5UKRlL63bqJoE0bUcnLCDxBsWWZVn@/l@2k2vnYgyiEwSeuddmurb8YAsMuNtP/cvALIcOTwH8OLGAUgOhXQUpa0y9Bv61ga4ongJwQk/NO7OrrhbEIeCVp7Fl2/GNkTSV0De3p8CF5nCM1GwGxg@XF9tpM@w9yxdthpgt2uchF@fR6EqVSqmci@ws@JXT/0DKO7O8f6iqBKo/QLPU3zEHJkOTKqUxc7gu5040@vHn2@R0jB/O9816F2VPnw "C (gcc) – Try It Online")
[Answer]
# [Kotlin](https://kotlinlang.org), 106 bytes
```
fun String.p()=split(Regex("(?=(.)\\1*$)")).let{Math.pow((it[0].max()?:'0')-'0'+.0,1.0/(it.size-1))}%1==.0
```
Output: true/false
[Try it online!](https://tio.run/##bU5dr8FAEH3vr2gaYsbHmGVRosQP8MIjHvahaqNW0@7NdYnfXt14cIOZzGRyTuacczzbVJuy3P8Yf21zbRLKAKMiS7WFVZzEFwhgHgHhdiuaNQwQKY3tbansgbLzL4C2G97RSV0A55MGN7BTrRZxWxB3K5YKfY07AvFeF1FE7HnO66S0AZUnxcRf5Ln6mz7NZ@jfvKy6bGogkCLkHjMHLhO@cPEF6vXlYDgKw3dCDsSz3gn3IN24lvJT8ENJjP@nuZflAw "Kotlin – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~26~~ 18 bytes
```
ó¶
o l
ñ o n qV v1
```
[Try it online!](https://tio.run/##y0osKPn///DmQ9u48hVyuA5vVMhXyFMoDFMoM/z/X8nE0MLAyMDAQAkA)
---
Takes input as a string, returns `1` for pleasing numbers, `0` otherwise.
Short explanation:
```
ó¶
```
Take the first input and split it by values where `(x,y) => x===y` is true. For example `'41802000'` to `['4','1','8','0','2','000']`.
```
o l
```
Take the array from the first step, remove the last element and get its length, yielding **B**.
```
ñ o n qV v1
```
Find the largest element in the remaining array, yielding **A**, take it to the power `1/B` and then return if the result is divisible by one.
---
First time working with Japt, very open to any recommendations.  
Shaved off 8 bytes thanks to [ETHproductions](https://codegolf.stackexchange.com/users/42545/ethproductions).
[Answer]
# [Ruby](https://www.ruby-lang.org/), 64 bytes
```
->a{!([a[/(\d)\1*$/].size,$`.chars.max]*?x!~/x1$|^2x[49]|^3x8/)}
```
Input as a string, returns true if:
* B==1 (no need to check A)
* A==4 and B==2
* A==9 and B==2
* A==8 and B==3
[Try it online!](https://tio.run/##JYxLDoIwFACvItgFkNofRetCPUh5xPohujAhEJOnbb16xTiZ2c74PL1Sv0urvfNZYZ3lRXspW1kRDmy6v6@UHNn55saJPRxCdcDsw1GS0Cm0eguhq9HwMiarpRFKCEHlLzVb62a9MYbqRv6B@TH4gGFYWKS9zZceYw4Q0xc "Ruby – Try It Online")
[Answer]
# [Perl 6](http://perl6.org/), 55 bytes
```
{m/(\d+?)((\d)$0*)$/;so any(^10)**$1.comb==$0.comb.max}
```
[Try it online!](https://tio.run/##JUtbDoIwELzKhjSmrQns4oIoohcxmvrolxUDPzaEs9cWZzKPbHY@z@FVB@dhZaELkyvk@bE@KRlDCdRKFO3Yg3l7eSFUWgvK7727dZ3ApeTOfOfQwmg8ZJMFcZ330TKw/QAHpgZLRARKKjdc1dumAa7oD0gnTkpkjj/AtFs2xzb8AA "Perl 6 – Try It Online")
After the evaluation of the initial regex--which can only succeed if the input is a positive integer--`$0` contains the initial part of the number, and `$1` contains the trailing repeated digits.
The `comb` method without arguments, applied to a string, returns a list of the characters, which in numeric context evaluates to the length of the list. So `$0.comb.max` is the largest of the digits in the prefix, and `$1.comb` is the length of the suffix.
We then check whether `any(^10)` (ie, the or-junction of the numbers from 0-9), when raised to the power of the length of the suffix, is equal to the largest digit in the prefix. The `so` forces boolean evaluation of the resulting junction, which would otherwise be just fine on its own as a truthy value, but the challenge calls for just two distinct values to be returned.
[Answer]
# [Add++](https://github.com/cairdcoinheringaahing/AddPlusPlus), 21 bytes
```
L,BGubLV@¦+bMG1$/^1%!
```
[Try it online!](https://tio.run/##S0xJKSj4/99Hx8m9NMknzOHQMu0kX3dDFf04Q1XF/yo5iblJKYkKhnb2XP5cRPP@/482UTBUsFAwUDACYiCM/R9tpGCsYKJgCsQwGoaBEChvqGAUC9JnCtSJBGMB "Add++ – Try It Online")
It's been 3 and a half months, I hope I'm not ninja'ing anyone.
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), 132 bytes
```
n=>{int A=0,B=1,s=1,i=n.Length-1;for(;i-->0;)if(n[i]==n[i+1]&s>0)B++;else{A=n[i]>A?n[i]:A;s=0;}return System.Math.Pow(A,1d/B)%1==0;}
```
[Try it online!](https://tio.run/##lZBBS8QwEIXP9lfkojR0Wpu16mpMpRU87ULBg4fSQ@1mdwM1gSZ1kdLfXlOxIp5aHm8GMvOYj1Tar1TDh1YLeUAvn9rwd@pUdak1yjpHm9KICj23snoQ0uQFoDel6hhlNS@/IwwNksWdHaKEhZAyAtpaMBlsuDyYo0/oXjUuFb4fhxSLvStzUTBmq0eKCx2HOPU8ymvNu2R8LeLkcWz3CdUspH3DTdvIH7ZgW5pjkKmTmwDZXab4nLBxaaDOBPuhxA5tSyFd7HTO2ZOSWtU8eG2E4RshuTuxu5Kf8gJ1KAICawhhZW2FeozprCBZur6CK4jgGm7g1l5cz4@OIfJX86PTzei3T7ZaBL8El8Dd/x/tnX74Ag "C# (.NET Core) – Try It Online")
### Acknowledgements
-12 bytes thanks to @KevinCruijssen
### DeGolfed
```
n=>{
    int A=0, // maximum digit
        B=1, // count of trailing identical numbers
        s=1, // 1 if dealing with trailing numbers, 0 otherwise
        i=n.Length-1;
    for(; i-- > 0;)
        if(n[i] == n[i+1] & s > 0)
            B++;
        else
        {
            A = n[i] > A? n[i] : A;
            s = 0;
        }
    return Math.Pow(A, 1d/B) % 1 == 0;
}
```
[Answer]
## Clojure, 168 bytes
```
(fn[x](let[y(reverse(vec x))z(count(take-while #(= %(first y))y))a(apply max(map #(-(int %)48)(drop z y)))b(Math/pow a(/ 1 z))](<(Math/abs(- b(Math/round b)))0.00001)))
```
[Try it online!](https://tio.run/##1VRRbsIwDP3fKSwQ0vNHoWFhFAmOsBMgPtISRFloozQtbS/fpWI7RJ5jyYmeEz/FcmHqR@v0NMG6svKmIuBWnfsLjPbnAU532jUanS6oZx5R1G3l4dWPTl730mha4kQr3ErXeBqYw1JQ1pqBnqrHU9nASBDuphXLjHF1taVxpnKOb@XvG1u/SGFDgkbmC47vU5U3SOiP4sKrV8pDTrpOA0SIaCFFlm7DbsH8EWP9IuLSt59y97XPslgFyJ14I1YB8wfI2WeTMt5GiraDxOF/@kzTLw)
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 33 bytes
```
≔ＥＳιθ⊞υ⊟θＷ⁼§υ⁰§θ±¹⊞υ⊟θ¬﹪ＸＩ⌈θ∕¹Ｌυ¹
```
[Try it online!](https://tio.run/##ZY2xCsMgEIb3PoXjCRZM6VDIFNoOgSYIfQJpJBGMxqhJ3t6eQ6ce3HAf/33/Z5Lrx0mTcxOCHi10coHWLim@46rtCJQRjetpfRIpTJAYEW4BTxHskzaKwNMnaQI0sbWDOkqC48fv9Iz0apRRQUVxyJ9FYE@E3kXo3JCMA@F2tcJdBiTy0HOaS5CRh970gBpGXsqOES204KKtc75WN37hnOfzZr4 "Charcoal – Try It Online") Link is to verbose version of code. Outputs a `-` for pleasing numbers. Explanation:
```
≔ＥＳιθ
```
Split the input `q` into characters.
```
⊞υ⊟θ
```
Remove the last character from `q` and push it to `u` (predefined to an empty list).
```
Ｗ⁼§υ⁰§θ±¹⊞υ⊟θ
```
Repeatly pop and push while the last character of `q` is the first character of `u`.
```
¬﹪ＸＩ⌈θ∕¹Ｌυ¹
```
Take the maximum digit of `q` and raise it to the power of the reciprocal of the length of `u`, then check whether the result is an integer.
[Answer]
# [Python 2](https://docs.python.org/2/), ~~91~~ 85 bytes
```
s=`input()`;d=0
p=s.rstrip(s[-1])
exec"`d**(len(s)-len(p))`==max(p)>exit(1);d+=1;"*10
```
[Try it online!](https://tio.run/##FcbBCsIwDADQ@z5jp6QySYaHQYk/IkJlLazgalgq1K@venpPP3V7lbl3k5CLvitg8FFoULHzYfXICnab@I5DamkdQ3QOnqmA4fRHEYPI/mi/XVPLFRh9PAn70TH1fuGFZiL6Ag "Python 2 – Try It Online")
[Answer]
# [Perl 5](https://www.perl.org/), 73 + 1 (`-p`) = 74 bytes
```
s/(.)\1*$//;$/=length$&;$_=(sort/./g)[-1];$q=$"++**$/while$q<$a;$_=$q==$a
```
[Try it online!](https://tio.run/##FcpNCoUgFAbQvTw@Hv2gVweNzCW0gopoIBVIWgrtvluNz4nu9A1zokKWg65AZEDWu33JK/4Gky1SODNJWspe6NHgsPjVdfXWa928w9Fi/t4LFjOzVuoOMW9hTyy6RiqtWMQH "Perl 5 – Try It Online")
[Answer]
# Java 8, 125 bytes
```
a->{int A=0,B=1,f=1,i=a.length-1;for(;i-->0;)if(a[i]==a[i+1]&f>0)B++;else{A=a[i]>A?a[i]:A;f=0;}return Math.pow(A,1d/B)%1==0;}
```
Port of [*@Ayb4btu*'s C# .NET answer](https://codegolf.stackexchange.com/a/152068/52210).
[Try it online.](https://tio.run/##lVDBbsIwDL33K3zZlAq3axjb2KJ0Kvdx4Yh6CCWFsJKiNoCmqt/euTCmSbuArGcrtp/8XjbqoILN8rPLClXX8KGMbTwAY52ucpVpmPZPgEVZFlpZyBiN5ikoX1C/9SjVTjmTwRQsSOhUEDe0AomMcCI55gQjVVhou3LrgIu8rJgwQRBHwjc5U3OTSkl5wNP7PI78yWAgdFHrJum7aZy89@UtEbmMRFtpt68s6XTrcFceWYJ8@TDx77jsp53oBe32i4IE/eg6lGYJW/LFZq4ydjVPlX/2NPuqnd6G5d6FO5q4wjIbZszqI5xMNiPkOMYIhwSK1j@ZvoLIb10f4iOO8Amf8YUujq@n9iT@N66nXm6OfusFFDeJv0Uux9d/P9p6bfcN)
**Explanation:**
```
a->{                       // Method with digit-array parameter and boolean return-type
  int A=0,                 //  Maximum digit `A` as specified in the challenge description
      B=1,                 //  `B` as specified in the challenge description
      f=1,                 //  Flag-integer, starting at 1
      i=a.length-1;        //  Index integer `i`
  for(;i-->0;)             //  Loop `i` backwards over the digits (excluding the last)
    if(a[i]==a[i+1]        //   If the current and next digits are the same,
       &f>0)               //   and the flag is still 1
      B++;                 //    Increase `B` by 1
    else{                  //   Else:
      A=a[i]>A?            //    If the current digit is larger than `A` 
         a[i]              //     Replace `A` with the current digit
        :                  //    Else:
         A;                //     Leave `A` the same
      f=0;}                //    Set the flag-integer to 0
  return Math.pow(A,1d/B)  //  Return if `A` ^ (1/`B`)
    %1==0;}                //  is an exact integer
```
[Answer]
# [Pip](https://github.com/dloscutoff/pip), ~~32~~ ~~22~~ 21 bytes
```
'.N(#a-#Ya<|a@v)RTMXy
```
Uses `1` for *falsey* and `0` for *truthy*, saving a byte. [Try it online!](https://tio.run/##K8gs@P9fXc9PQzlRVzky0aYm0aFMMyjEN6Ly////JoYWBkYGBgYA "Pip – Try It Online")
[Answer]
## Pyth, 29 bytes
```
JezWqezJ=Pz=hZ)[[email protected]](/cdn-cgi/l/email-protection)
```
[**Test suite**](https://pyth.herokuapp.com/?code=JezWqezJ%3DPz%3DhZ%29K%40sh.MsZzZqKsK&test_suite=1&test_suite_input=41802000%0A100%0A123456788%0A451111111%0A234543454545444%0A12%0A41902000&debug=0)
Python 3 translation:
```
Z=0
z=input()
J=z[-1]
while z[-1]==J:
    z=z[:-1]
    Z+=1
K=max(map(int,z))**(1/Z)
print(K==int(K))
```
]