[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!!! ๐๐ป