Skip to content

Docstring title and output explanation contradict the problem in find_el_where_k_greater_or_equal.py #34

Description

@chirag127

Problem

The file's docstring title and output explanation invert the direction of the comparison versus the actual problem statement and implementation.

Steps

  1. Open Arrays/find_el_where_k_greater_or_equal.py.
  2. 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions