Problem
The file's docstring title and output explanation invert the direction of the comparison versus the actual problem statement and implementation.
Steps
- Open
Arrays/find_el_where_k_greater_or_equal.py.
- Read line 2 (title), line 4 (problem statement), line 10 (output explanation).
Expected
Title and explanation match the body: X such that K elements are >= X.
Actual
- Line 2:
Find an Element Which is Smaller or Equal to Exactly K Numbers (says smaller-or-equal).
- Line 4:
K elements in that list are greater than or equal to the number X (correct).
- Line 10:
Only 20 and 24 are equal or smaller from 11 — but 20 and 24 are greater than 11, not smaller.
The implementation (return arr[-(k + 1)] + 1) matches line 4, so lines 2 and 10 are the documentation errors.
Environment
Repo master @ commit visible via gh api repos/MTrajK/coding-problems; Python 3 (per README).
Thanks for maintaining MTrajK/coding-problems!
Problem
The file's docstring title and output explanation invert the direction of the comparison versus the actual problem statement and implementation.
Steps
Arrays/find_el_where_k_greater_or_equal.py.Expected
Title and explanation match the body: X such that K elements are
>=X.Actual
Find an Element Which is Smaller or Equal to Exactly K Numbers(says smaller-or-equal).K elements in that list are greater than or equal to the number X(correct).Only 20 and 24 are equal or smaller from 11— but 20 and 24 are greater than 11, not smaller.The implementation (
return arr[-(k + 1)] + 1) matches line 4, so lines 2 and 10 are the documentation errors.Environment
Repo master @ commit visible via
gh api repos/MTrajK/coding-problems; Python 3 (per README).Thanks for maintaining MTrajK/coding-problems!