A qualifying parcel or a qualifying zone

A warehouse assigns each parcel a two-digit integer code. The tens digit identifies its delivery zone. Even codes identify parcels eligible for an automated conveyor; odd codes identify parcels requiring manual handling.


Python
codes = {12, 13, 21, 24, 30, 31, 42, 44, 51, 53, 60, 62}


For these positive integers, code // 10 extracts the tens digit, and code % 2 == 0 tests whether a code is even. The following Python expression is available as a starting point:


Python
automated_zones = {
    code // 10 for code in codes if code % 2 == 0
}


Find both quantities below, considering only zones represented in codes:

  • The number of zones with at least one conveyor-eligible parcel.
  • The number of zones in which every recorded parcel is conveyor-eligible.

Enter both counts as exact integers, measured in zones.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Set Data Structure Questions: