In this challenge, you have to establish if the digits of a given number form a sequence (ascending or descending).
Given an integer n, implement a function that returns a string:
"Metadrome" if the digits of n form an ascending sequence without repeating digits."Plaindrome" if the digits of n form an ascending sequence with repeating digits."Katadrome" if the digits of n form a descending sequence without repeating digits."Nialpdrome" if the digits of n form a descending sequence with repeating digits."Repdrome" if n contains a single repeating digit."Nondrome" if none of the above conditions is true.digitaldrome(1357) ➞ "Metadrome"
// Ascending sequence without repeating digits
digitaldrome(12344) ➞ "Plaindrome"
// Ascending sequence with repeating digits
digitaldrome(7531) ➞ "Katadrome"
// Descending sequence without repeating digits
digitaldrome(9874441) ➞ "Nialpdrome"
// Descending sequence with repeating digits
digitaldrome(666) ➞ "Repdrome"
// There's only a single repeating digit
digitaldrome(1985) ➞ "Nondrome"
// This is not a sequence
n will be a positive integer.