4 kyu

1 unique common number in every pair

53 of 80Zzudo

Description:

In this kata, you are given a prime number p. Your goal is to generate an array of p² + p + 1 arrays, each consisting of p + 1 distinct numbers between 1 and p² + p + 1 included. This set of arrays is such that for any pair of arrays, they both have exactly one number in common.

For example, a valid output for p = 2 is:

[
  [7,2,4],
  [1,7,3],
  [4,3,5],
  [6,4,1],
  [1,2,5],
  [2,6,3],
  [6,5,7]
]

The order of the output does not matter. The input range tested for this kata goes up to p = 31.

Algorithms
Combinatorics
Arrays
Mathematics
Geometry

Stats:

CreatedJan 30, 2020
PublishedJan 31, 2020
Warriors Trained521
Total Skips16
Total Code Submissions680
Total Times Completed80
JavaScript Completions53
Python Completions32
Total Stars24
% of votes with a positive feedback rating93% of 21
Total "Very Satisfied" Votes19
Total "Somewhat Satisfied" Votes1
Total "Not Satisfied" Votes1
Total Rank Assessments5
Average Assessed Rank
4 kyu
Highest Assessed Rank
3 kyu
Lowest Assessed Rank
5 kyu
Ad
Contributors
  • Zzudo Avatar
  • kazk Avatar
  • dfhwze Avatar
Ad