Company: COMCAST EXAM_13thjuly

Difficulty: medium

Problem Statement

A logistics company receives a large shipment of cargo containers labeled with a string S of digits. The warehouse manager wants to sort these digits into as many valid container IDs as possible. A valid container ID is an ID divisible by 3. The digits are printed as one large uninterrupted serial number, and the manager can place vertical barcode cuts between any pair of adjacent digits to break this serial into smaller container IDs. Your task is to split and return an integer value representing the maximum number of valid container IDs. Note: Each resulting ID must be a valid number (i.e., no leading zeroes unless the entire ID is just '0'). Input Specification: input1 : A string S representing the full container serial number. Output Specification: Return an integer value representing the maximum number of valid container IDs.

More COMCAST EXAM_13thjuly OA questionsInterview experiences