Números estéticos
Um número é estético se, em qualquer base de base2 até base10, a diferença absoluta entre cada par de dígitos adjacentes for constantemente igual a 1.
num = 441 (base10)
// Adjacent pairs of digits:
// |4, 4|, |4, 1|
// The absolute difference is not constant
// 441 is not Esthetic in base10
441 in base4 = 12321
// Adjacent pairs of digits:
// |1, 2|, |2, 3|, |3, 2|, |2, 1|
// The absolute difference is constant and is equal to 1
// 441 is Esthetic in base4Dado um inteiro positivo num, implemente uma função que retorne um array contendo as bases (como inteiros de 2 até 10) nas quais num resulta ser estético, ou a string "Anti-Esthetic" se nenhuma base tornar num estético.
Exemplos
esthetic(10) ➞ [2, 3, 8, 10]
// 10 in base2 = 1010
// 10 in base3 = 101
// 10 in base8 = 12
// 10 in base10 = 10
esthetic(23) ➞ [3, 5, 7, 10]
// 23 in base3 = 212
// 23 in base5 = 43
// 23 in base7 = 32
// 23 in base10 = 23
esthetic(666) ➞ [8]
// 666 in base8 = 1232Observações
N/A