Your question is Python: Prime, Two-Sum, Inheritance. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Ford Hospital and Research Center needs a reusable Python component for screening integer batches. Implement one function that identifies prime values, finds two distinct input positions whose values sum to a target, and demonstrates object-oriented design through inheritance and a decorator.
is_prime(number) logic inside the solution. A prime is an integer greater than 1 with exactly two positive divisors.nums, produce a Boolean indicating whether it is prime.[i, j], with i < j, such that nums[i] + nums[j] == target. Return None if no pair exists. Use a hash map for expected linear time.ScreeningReport and a child class ClinicalScreeningReport that inherits from it. The child must override a formatting method.prime_flags, pair, and report. The report must be the string produced by the child class and include the word AUDITED.Input is nums, a list of integers, and target, an integer. Output is a dictionary containing prime_flags as a Boolean list, pair as a two-element index list or None, and report as a string.
def screen_numbers(nums, target):