6 kyu
Do the points form a square?
308 of 338user6800471
Description:
You are given a list of four points (x, y). Each point is a tuple
Your task is to write a function which takes an array of points and returns whether they form a square.
If the array doesn't contain 4 points, return False.
All points coordinates are integers.
Squares can be rotated using a random degree.
Examples
((1,1), (3,3), (1,3), (3,1)) -> True
((0, 0), (0,2), (2,0), (2,1)) -> False
([]) -> False
Constraints:
1 <= x, y <= 1000
Note:
Performance does not enforced in this kata.
Fundamentals
Arrays
Similar Kata:
Stats:
Created | Nov 6, 2021 |
Published | Nov 6, 2021 |
Warriors Trained | 1038 |
Total Skips | 25 |
Total Code Submissions | 3048 |
Total Times Completed | 338 |
Python Completions | 308 |
C Completions | 33 |
Total Stars | 34 |
% of votes with a positive feedback rating | 90% of 97 |
Total "Very Satisfied" Votes | 80 |
Total "Somewhat Satisfied" Votes | 14 |
Total "Not Satisfied" Votes | 3 |
Total Rank Assessments | 26 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |