Problem Statement
Definition
- Class:
- MatchCounts
- Method:
- howMany
- Parameters:
- String[]
- Returns:
- int
- Method signature:
- int howMany(String[] ability)
- (be sure your method is public)
Constraints
- ability will contain between 1 and 6 elements, inclusive.
- Each element of ability will contain between 1 and 6 characters, inclusive.
- Each character in ability will be a digit between '0' and '5', inclusive.
- No character will appear more than once in a single element of ability.
Examples
{"045"}
Returns: 3
Person 0 can perform 3 different tasks.
{"01","23"}
Returns: 4
Two choices for person 0 and two choices for person 1.
{"01","01"}
Returns: 2
Both people have two choices, but not all 2*2 possibilities are feasible.
{"0","0"}
Returns: 0
{"012345","012345","012345","012345","012345","012345"}
Returns: 720
{"402","251340","2530"}
Returns: 40
{"520134"}
Returns: 6
{"3","015","5"}
Returns: 2
{"45230","140","2","130"}
Returns: 18
{"3","2504","013425","1","30"}
Returns: 6
{"452","024513","342105","253","34","1302"}
Returns: 40
{"510234","52013","3","015","1"}
Returns: 8
{"453210","45301","14","043","405231"}
Returns: 90
{"431025"}
Returns: 6
{"3","0412","2"}
Returns: 3
{"1502","3","0","3"}
Returns: 0
{"24031","021","3","2054","5203","420513"}
Returns: 28
{"1","53014","314025"}
Returns: 16
{"12035","513"}
Returns: 12
{"20","502431"}
Returns: 10
{"243015","312540"}
Returns: 30
{"2","32","2304"}
Returns: 2
{"15","0423","354012","301"}
Returns: 48
{"405312","3","5042","4","423510","1345"}
Returns: 10
{"213","105432","5413"}
Returns: 40
{"35412","50142","043","02","40152","41"}
Returns: 28
{"50413","35"}
Returns: 8
{"3514","14"}
Returns: 6
{"014","25041","01253","4","3201"}
Returns: 28
{"021453"}
Returns: 6
{"53","4","50231"}
Returns: 8
{"14352","2401","3105"}
Returns: 48
{"045","1","215430","2345"}
Returns: 30
{"1","42315","3245","045321"}
Returns: 36
{"2154","2","12350"}
Returns: 10
{"4253","53","4","351","402531","102"}
Returns: 10
{"240513","103","1025","234","21504","1302"}
Returns: 72
{"325410","4053","0354","02","51402","1"}
Returns: 28
{"213045","0","2"}
Returns: 4
{"21","5","52"}
Returns: 1
{"0", "01234", "01234" }
Returns: 12
{"245", "145", "125" }
Returns: 11
{"5", "5" }
Returns: 0