From e951b72d7230b04d8e1f2f2bf4d0637f05a6b009 Mon Sep 17 00:00:00 2001 From: Aditya Singh Date: Wed, 3 Jun 2026 13:19:05 +0530 Subject: [PATCH] fix(curriculum): editable regions in workshop binary search (#67780) --- .../683ec95f2f8781355556ff7a.md | 2 +- .../683ec95f2f8781355556ff7b.md | 2 +- .../683ec95f2f8781355556ff7c.md | 1 + .../683ec95f2f8781355556ff7d.md | 4 ++-- .../683ec95f2f8781355556ff7e.md | 3 +-- .../683ec95f2f8781355556ff7f.md | 2 +- .../683ec95f2f8781355556ff80.md | 1 + .../683ec95f2f8781355556ff81.md | 8 ++++---- .../683ec95f2f8781355556ff82.md | 5 +++-- .../683ec95f2f8781355556ff83.md | 9 +++++---- .../683ec95f2f8781355556ff84.md | 7 ++++--- .../684165a72e33e26a40904f8b.md | 7 ++++--- .../684169b00a073c9b9f0a703c.md | 8 ++++---- .../68416aab85dd00a7852cdeb6.md | 6 +++--- .../68416d66013635cb6325eb6d.md | 11 ++++++----- 15 files changed, 41 insertions(+), 35 deletions(-) diff --git a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7a.md b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7a.md index 8be340d6db9..4bec45b1f77 100644 --- a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7a.md +++ b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7a.md @@ -31,8 +31,8 @@ You should create a `path_to_target` variable set to an empty list within your ` ## --seed-contents-- ```py ---fcc-editable-region-- def binary_search(search_list, value): +--fcc-editable-region-- pass --fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7b.md b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7b.md index bd6b8c52d83..d26ce650d17 100644 --- a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7b.md +++ b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7b.md @@ -60,9 +60,9 @@ Your `high` variable should be set to `len(search_list) - 1`. ## --seed-contents-- ```py ---fcc-editable-region-- def binary_search(search_list, value): path_to_target = [] +--fcc-editable-region-- --fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7c.md b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7c.md index bca294eb695..4f7896158a1 100644 --- a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7c.md +++ b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7c.md @@ -37,6 +37,7 @@ def binary_search(search_list, value): path_to_target = [] low = 0 high = len(search_list) - 1 + --fcc-editable-region-- --fcc-editable-region-- diff --git a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7d.md b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7d.md index a80fa42931e..ec1ff2352ad 100644 --- a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7d.md +++ b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7d.md @@ -35,9 +35,9 @@ def binary_search(search_list, value): path_to_target = [] low = 0 high = len(search_list) - 1 - ---fcc-editable-region-- + while low <= high: +--fcc-editable-region-- pass --fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7e.md b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7e.md index bb5ad1536a3..b0aad63ae7e 100644 --- a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7e.md +++ b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7e.md @@ -34,10 +34,9 @@ def binary_search(search_list, value): low = 0 high = len(search_list) - 1 ---fcc-editable-region-- while low <= high: mid = (low + high) // 2 - +--fcc-editable-region-- --fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7f.md b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7f.md index 6c1e2c63cb0..23003328040 100644 --- a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7f.md +++ b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff7f.md @@ -32,10 +32,10 @@ def binary_search(search_list, value): low = 0 high = len(search_list) - 1 ---fcc-editable-region-- while low <= high: mid = (low + high) // 2 value_at_middle = search_list[mid] +--fcc-editable-region-- --fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff80.md b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff80.md index 156c5026de1..bc2d7a24371 100644 --- a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff80.md +++ b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff80.md @@ -49,6 +49,7 @@ def binary_search(search_list, value): mid = (low + high) // 2 value_at_middle = search_list[mid] path_to_target.append(value_at_middle) + --fcc-editable-region-- --fcc-editable-region-- diff --git a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff81.md b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff81.md index 08cd39d9eeb..4d97729c6c6 100644 --- a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff81.md +++ b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff81.md @@ -47,15 +47,15 @@ def binary_search(search_list, value): path_to_target = [] low = 0 high = len(search_list) - 1 - + while low <= high: mid = (low + high) // 2 value_at_middle = search_list[mid] path_to_target.append(value_at_middle) - ---fcc-editable-region-- + if value == value_at_middle: return path_to_target - +--fcc-editable-region-- + --fcc-editable-region-- ``` diff --git a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff82.md b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff82.md index 8e449d15558..65c6dc5a6cc 100644 --- a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff82.md +++ b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff82.md @@ -47,12 +47,13 @@ def binary_search(search_list, value): mid = (low + high) // 2 value_at_middle = search_list[mid] path_to_target.append(value_at_middle) - + if value == value_at_middle: return path_to_target break + return [] - + --fcc-editable-region-- --fcc-editable-region-- diff --git a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff83.md b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff83.md index e264ccf0557..c082e57aade 100644 --- a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff83.md +++ b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff83.md @@ -38,13 +38,14 @@ def binary_search(search_list, value): mid = (low + high) // 2 value_at_middle = search_list[mid] path_to_target.append(value_at_middle) - ---fcc-editable-region-- + if value == value_at_middle: return path_to_target - ---fcc-editable-region-- +--fcc-editable-region-- + +--fcc-editable-region-- break + return [] print(binary_search([1, 2, 3, 4, 5], 3)) diff --git a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff84.md b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff84.md index 9df4974a341..e1dc6d15d7c 100644 --- a/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff84.md +++ b/curriculum/challenges/english/blocks/workshop-binary-search/683ec95f2f8781355556ff84.md @@ -36,14 +36,15 @@ def binary_search(search_list, value): mid = (low + high) // 2 value_at_middle = search_list[mid] path_to_target.append(value_at_middle) - + if value == value_at_middle: return path_to_target ---fcc-editable-region-- elif value > value_at_middle: - pass --fcc-editable-region-- + pass +--fcc-editable-region-- break + return [] print(binary_search([1, 2, 3, 4, 5], 3)) diff --git a/curriculum/challenges/english/blocks/workshop-binary-search/684165a72e33e26a40904f8b.md b/curriculum/challenges/english/blocks/workshop-binary-search/684165a72e33e26a40904f8b.md index 3015c8786ee..90a6947f856 100644 --- a/curriculum/challenges/english/blocks/workshop-binary-search/684165a72e33e26a40904f8b.md +++ b/curriculum/challenges/english/blocks/workshop-binary-search/684165a72e33e26a40904f8b.md @@ -30,12 +30,12 @@ def binary_search(search_list, value): path_to_target = [] low = 0 high = len(search_list) - 1 - + while low <= high: mid = (low + high) // 2 value_at_middle = search_list[mid] path_to_target.append(value_at_middle) - + if value == value_at_middle: return path_to_target elif value > value_at_middle: @@ -43,8 +43,9 @@ def binary_search(search_list, value): --fcc-editable-region-- break --fcc-editable-region-- - return [] + return [] + print(binary_search([1, 2, 3, 4, 5], 3)) print(binary_search([1, 2, 3, 4, 5, 9], 4)) ``` diff --git a/curriculum/challenges/english/blocks/workshop-binary-search/684169b00a073c9b9f0a703c.md b/curriculum/challenges/english/blocks/workshop-binary-search/684169b00a073c9b9f0a703c.md index eb0a0995488..a41ea553b27 100644 --- a/curriculum/challenges/english/blocks/workshop-binary-search/684169b00a073c9b9f0a703c.md +++ b/curriculum/challenges/english/blocks/workshop-binary-search/684169b00a073c9b9f0a703c.md @@ -35,21 +35,21 @@ def binary_search(search_list, value): path_to_target = [] low = 0 high = len(search_list) - 1 - + while low <= high: mid = (low + high) // 2 value_at_middle = search_list[mid] path_to_target.append(value_at_middle) - + if value == value_at_middle: return path_to_target elif value > value_at_middle: low = mid + 1 else: high = mid - 1 - - return [] + return [] + print(binary_search([1, 2, 3, 4, 5], 3)) print(binary_search([1, 2, 3, 4, 5, 9], 4)) --fcc-editable-region-- diff --git a/curriculum/challenges/english/blocks/workshop-binary-search/68416aab85dd00a7852cdeb6.md b/curriculum/challenges/english/blocks/workshop-binary-search/68416aab85dd00a7852cdeb6.md index 51583769f8d..71021e4a13a 100644 --- a/curriculum/challenges/english/blocks/workshop-binary-search/68416aab85dd00a7852cdeb6.md +++ b/curriculum/challenges/english/blocks/workshop-binary-search/68416aab85dd00a7852cdeb6.md @@ -33,19 +33,19 @@ def binary_search(search_list, value): path_to_target = [] low = 0 high = len(search_list) - 1 - + while low <= high: mid = (low + high) // 2 value_at_middle = search_list[mid] path_to_target.append(value_at_middle) - + if value == value_at_middle: return path_to_target elif value > value_at_middle: low = mid + 1 else: high = mid - 1 - + --fcc-editable-region-- return [] --fcc-editable-region-- diff --git a/curriculum/challenges/english/blocks/workshop-binary-search/68416d66013635cb6325eb6d.md b/curriculum/challenges/english/blocks/workshop-binary-search/68416d66013635cb6325eb6d.md index 8892d5b2d49..9410b276ca8 100644 --- a/curriculum/challenges/english/blocks/workshop-binary-search/68416d66013635cb6325eb6d.md +++ b/curriculum/challenges/english/blocks/workshop-binary-search/68416d66013635cb6325eb6d.md @@ -37,11 +37,12 @@ def binary_search(search_list, value): path_to_target = [] low = 0 high = len(search_list) - 1 + while low <= high: mid = (low + high) // 2 value_at_middle = search_list[mid] path_to_target.append(value_at_middle) - + if value == value_at_middle: --fcc-editable-region-- return path_to_target @@ -50,7 +51,7 @@ def binary_search(search_list, value): low = mid + 1 else: high = mid - 1 - + return [], "Value not found" print(binary_search([1, 2, 3, 4, 5], 3)) @@ -65,19 +66,19 @@ def binary_search(search_list, value): path_to_target = [] low = 0 high = len(search_list) - 1 - + while low <= high: mid = (low + high) // 2 value_at_middle = search_list[mid] path_to_target.append(value_at_middle) - + if value == value_at_middle: return path_to_target, f"Value found at index {mid}" elif value > value_at_middle: low = mid + 1 else: high = mid - 1 - + return [], "Value not found" print(binary_search([1, 2, 3, 4, 5], 3))