Ошибка в эталонном решении find_k_numbers.clj

Open
#1,072 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
clojure
Domain
testing-qa

Research direction

Open src/battle_asserts/issues/find_k_numbers.clj and reproduce the reported input ([1,2,3,4,5,6,6,7], 3). Check the reference solution’s handling of duplicate values; it is done when the result is 5 for this case and the existing task behavior remains valid.

Written by the indexing model from the issue text.

Description

В задаче КМК не верное эталонное решение:
https://github.com/hexlet-codebattle/battle_asserts/blob/master/src/battle_asserts/issues/find_k_numbers.clj
По заданию требуется вернуть K-ый по величине элемент, проблема проявляется, если в исходных данных есть несколько одинаковых значений, больше искомого, например:
solution = ([1,2,3,4,5,6,6,7], 3) должно быть равно 5 (7 -> 6 -> 5).
Но в эталонном решении ответ будет 6.

Dominant language
Clojure
Stars
71
Forks
67
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hexlet-codebattle/battle_asserts

All issues in hexlet-codebattle/battle_asserts

Similar issues

More Clojure issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.