about | help | code help+videos | done | prefs |
RECURSION IS OPTIONAL for this problem! Remember that it can help to work some examples out ON PAPER prior to starting! You MAY choose to use helper methods which may or may not be recursive. Write a method that accepts a string with the pre-condition that the string is made up of unique (non-matching) characters and has at least one character. Return the number of different arrangements that can be made using all of the letters from that string. For example, "ABC" has 6 arrangements: ABC, ACB, BAC, BCA, CAB, CBA. Producing all of these arrangements can be done nicely with recursion, but you do NOT have to produce the actual arrangements, just return how many there are. may12_2017_HL_mrEbbertsRevenge("mn") → 2 may12_2017_HL_mrEbbertsRevenge("mno") → 6 may12_2017_HL_mrEbbertsRevenge("i") → 1 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 490
Copyright Nick Parlante 2017 - privacy