[M💙 Challenge] Staircase Number
Monday Blue 💙 Challenge Series #11 Let's identify the pattern this week! This time we will need to determine whether the user provided number is a upward/downward staircase number or not. 💼 TASK Write a program to accept an integer and output whether it's an upward/downward staircase number and print "Not staircase number" if it's not the case. A staircase number have the following pattern:- ✔️ Compose of at least 2 distinct digits (0-9) ✔️ Same digit must be grouped together and occur at least twice Explanation: We need different digit to build the staircase step and if we plot the number as the y-value, we get a flat line with two or more occurences. So by connecting the lines we will get a staircase-like graph. ✔️ Upward if the unique digits are incerasing left-to-right ✔️ Downward if the unique digits are decreasing left-to-right Explanation: I believe this one is pretty self-descriptive. 😉 🔧 TEST CASE 11122333 "Upward staircase number" 11337788 "Upward staircase number" 33221100 "Downward staircase number" 9911 "Downward staircase number" 8080 "Not staircase number" 1234567 "Not staircase number" ❤ BONUS Clear-cut and optimized approach is encouraged. 👍 SPECIAL MENTION (RegEx submissions) https://code.sololearn.com/W23lPuTDqEP7/?ref=app https://code.sololearn.com/cvL9enWmJdFg/?ref=app https://code.sololearn.com/cRET7qJNZvt9/?ref=app https://code.sololearn.com/cf6oJ7dGwStu/?ref=app https://code.sololearn.com/cXqeHbpo6OMW/?ref=app https://code.sololearn.com/cJTYfsYAEQSE/?ref=app Happy Coding!!! 😁💻