about | help | code help+videos | done | prefs |
makeNoAdjacentLetterWords
//INCOMPLETE//INCOMPLETE//INCOMPLETE Recursively create a list of all possible words of size 'remaining' using the provided alphabet. (Due to codingbat limitations, all the letters are numbers) As an added restriction, do not allow consecutive letters to be ones adjacent to each other in the alphabet string. e.g. if your alphabet is "1234", then 1's and 2's cannot be next to each other, and 2's and 3's cannot be next to each other, 3's and 4's cannot be next to each other. Since coding bat only checks returned values, you must always return the list. The base case should add the word to the provided list of words, and return that list. After all recursive cases complete, you should return the list as well. //INCOMPLETE makeNoAdjacentLetterWords(1, "", "123", []) → [1, 2, 3] makeNoAdjacentLetterWords(2, "", "12", []) → [12, 21] makeNoAdjacentLetterWords(2, "", "123", []) → [12, 13, 21, 23, 31, 32] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy