# puzzle gauntlet advanced

The Final Door

The last door of the Puzzle Workshop has a three-part combination lock β€” one part per skill you've mastered. πŸšͺ✨

You get the nums and a target (present in the list). The three codes:

  1. SEARCH: the position of the target in the SORTED version of the list (binary search encouraged!).
  2. COUNT: how many even numbers the list holds.
  3. BEST: the biggest sum of two neighboring numbers in the ORIGINAL order.

Print the combination as <code1>-<code2>-<code3>.

Example:

Input: nums = [7, 2, 9, 4, 6], target = 9 Output: 4-3-13

Sorted gives [2, 4, 6, 7, 9], where 9 sits at position 4 (SEARCH). The evens are 2, 4, 6 β€” 3 of them (COUNT). Neighboring sums in the original order are 7+2=9, 2+9=11, 9+4=13, 4+6=10 β€” the biggest is 13 (BEST).

πŸ’‘ need a hint?

pg-final-door.pyπŸ”’ given lines are locked β€” write your code in between
loading...