about | help | code help+videos | done | prefs |
countNoDoubleLetterWords
Return the number of words that have no adjacent matching letters using the letters provided. This is possibly zero if there is only one unique letter provided, but that is an edge case. You MUST do this recursively, and actually count the words. DO NOT use math operations to multiply out the total. length: how long the words must be word: the variable to store the partial solution (Initial call should start at letters: will contain the unique letters allowed in the string. You may assume there are no duplicate letters in the string. countNoDoubleLetterWords(2, "", "a") → 0 countNoDoubleLetterWords(2, "", "ab") → 2 countNoDoubleLetterWords(3, "", "ab") → 2 ...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