id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

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)

public long countNoDoubleLetterWords(int length,String word, String letters){ }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Copyright Nick Parlante 2017 - privacy