<Challenge> "[🔡🏆] From a long text input, build a list of all the "n" characters chains in the text" </Challenge
The user is asked for the number "n" of letters. You can use a given source text in your code, but the idea in the end is that it would be an input and can be a long one. The code has to create a list of all the distinct existing chain of "n" characters in the source text (including whitespaces, ponctuation, numbers, ...]. ex 1 : text : "spameggspam" , n=0 output has to be : [] ex 2 : text : "spameggspam" , n=3 output has to be : ['spa', 'pam', 'ame', 'meg', 'egg', 'ggs', 'gsp'] ex 3 : text : "spameggspam" , n=4 output has to be : ['spam', 'pame', 'ameg', 'megg', 'eggs', 'ggsp', 'gspa'] ex 4 : text : "spameggspam" , n=2 output has to be : ['sp', 'pa', 'am', 'me', 'eg', 'gg', 'gs'] ex 5 : text : "now you got the idea", n=1 output has to be : ['n', 'o', 'w', ' ', 'y', 'u', 'g', 't', 'h', 'e', 'i', 'd', 'a'] Efficiency of the code is the most important aspect to care for. Not to be the shortest in line count, but the lightest to process. As I am a Python player, I deeply encourage whoever can to try it with Python, so that I can read your code ! Enjoy !