Question Assignment description

Problem Description: You might be stunned to know that 2013 is the primary 12 months since 1987 with distinct digits. The years 2014, 2015, 2016, 2017, 2018, 2019 every have distinct digits. 2012 doesn’t have distinct digits, because the digit 2 is repeated. Given a 12 months, what’s the subsequent 12 months with distinct digits? Write a operate known as distinctdigits(m), the place zero≤m≤10000, with m representing the beginning 12 months will return the following 12 months with distinct digits.Check your operate with following inputs:distinctdigits(1987) OUTPUT: 2013distinctdigits(999) OUTPUT: 1023

Published by
Essays
View all posts