Social Golfer Problem Validator V2
Description:
A group of N golfers wants to play in groups of G players for D days in such a way that each golfer plays exactly once with all other golfers
Sun ABC DEF GHI JKL MNO
Mon ADH BEK CIO FLN GJM
Tue AEM BHN CGK DIL FJO
Wed AFI BLO CHJ DKM EGN
Thu AGL BDJ CFM EHO IKN
Fri AJN BIM CEL DOG FHK
Sat AKO BFG CDN EIJ HLM
Write a function that validates a proposed solution, a list of list of strings, as being a solution to the social golfer problem. Each character represents a golfer, and each string is a group of players. Rows represent days. The solution above would be encoded as:
[
['ABC', 'DEF', 'GHI', 'JKL', 'MNO'],
['ADH', 'BEK', 'CIO', 'FLN', 'GJM'],
['AEM', 'BHN', 'CGK', 'DIL', 'FJO'],
['AFI', 'BLO', 'CHJ', 'DKM', 'EGN'],
['AGL', 'BDJ', 'CFM', 'EHO', 'IKN'],
['AJN', 'BIM', 'CEL', 'DOG', 'FHK'],
['AKO', 'BFG', 'CDN', 'EIJ', 'HLM']
]
You need to make sure (1) that each golfer plays exactly once every day, (2) that the number and size of the groups is the same every day, and (3) that each player plays with every other player exactly once.
It is not necessary to consider the case where the number of golfers is zero
All credits to rtoal for creating this kata, with his permission I just edited to add additional constraint. See original here: https://www.codewars.com/kata/social-golfer-problem-validator/
Similar Kata:
Stats:
Created | Apr 23, 2018 |
Published | Apr 23, 2018 |
Warriors Trained | 68 |
Total Skips | 1 |
Total Code Submissions | 141 |
Total Times Completed | 23 |
Python Completions | 23 |
Total Stars | 2 |
% of votes with a positive feedback rating | 96% of 12 |
Total "Very Satisfied" Votes | 11 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 11 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 6 kyu |