# puzzle gauntlet advanced

The Lost Library Book

The catalog lists book codes in sorted order — with duplicate copies side by side. Find a book FAST, then count its copies by checking the neighbors. 🔍

You get the SORTED codes and a target. Binary-search for it; if found, spread out from the hit to count every copy. Print found <count> copies or not found.

Example:

Input: codes = [101, 205, 205, 205, 377, 490], target = 205 Output: found 3 copies

Binary search lands on one of the 205s, then walking outward left and right finds two more copies — 3 total.

💡 need a hint?

pg-lost-library-book.py🔒 given lines are locked — write your code in between
loading...