Ring Buffer Dump Lookup accepts searches that miss the last entry
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
Observed behavior
The five built-in cases for Ring Buffer Dump Lookup (search-in-rotated-sorted-array) all pass for two incorrect implementations of the sorted-half binary search: one uses an exclusive right bound, and one treats a one-element left half as unsorted.
Expected behavior
A candidate must return the zero-based position of every present target, including the last element of a wrapped dump.
Reproduction
- Run a sorted-half binary search against the five built-in cases.
- Change only
target <= nums[hi]in the sorted-right-half branch totarget < nums[hi]. The built-in cases still pass 5/5, butlocateSequenceNumber([3, 1, 2], 2)returns-1instead of2. - Restore the right bound and change only the sorted-left-half test from
nums[lo] <= nums[mid]tonums[lo] < nums[mid]. The built-in cases still pass 5/5, butlocateSequenceNumber([2, 1], 1)returns-1instead of1.
CodeTrial version
Source at c24068bb67a06536cd6472ce91c1563fb38f472b
Environment
Windows, Node.js v24.22.0. I exercised CodeTrial's JavaScript runner and answer checker with a Node adapter for the Worker API. With both cases appended in memory, the correct search passes 7/7 and both incorrect versions pass 6/7.
Sanitized evidence
Proposed scope
Add these two cases to the judge source, regenerate the browser judge, update the task digest and contract assertions, and add a regression that checks which labeled case rejects each wrong implementation. Could you confirm the scope and assign this issue to me?
The examples are synthetic and contain no credentials or personal interview data.
Public data confirmation
- I removed credentials, session tokens, candidate recordings, and personal interview content from this public report.
- 主要语言
- Rust
- 星标
- 236
- 派生
- 153
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 187
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
sysprog21/codetrial 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 70/100
维护者通常 1 天内回复
-
Unify Java harness validation error messages可能已有人在做 @weichieh0204 今天认领。 未关闭
sysprog21/codetrial#872 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Inferred void class operations are never checked against the starter's return type可能已有人在做 @papaya0112 今天认领。 未关闭
sysprog21/codetrial#871 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Edge Thumbnail Store accepts a store that does not refresh a key on overwrite可能已有人在做 @BOBOGUAGUA428 今天认领。 未关闭
sysprog21/codetrial#869 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 sysprog21/codetrial 的全部 Issue
相似的 Issue
-
marketing
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
eliasstravik/herdr-projects#1605 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
jlcodes99/cockpit-tools#3332 ·
维护者通常 3 天内回复
-
Cognito: the email MFA code (EMAIL_OTP challenge after a password flow) has 8 digits; AWS delivers 6未关闭
难度 2/5 1-3 小时 新手友好度 72/100
aws/aws-emulator#692 ·
-
bug
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复