Problem Statement: A barcode scanner can be configured by scanning a series of barcodes in the correct order. Barcode configurations are encoded into a single string and stored as a blob in the backend system. The client requests the configuration from the backend service and then needs to present the configurations in the correct order. The encoded configuration string is a series of <ordinal-index><configuration> pairs separated by |. The ordinal index value is a 4-digit numeric prefixed with zeros. For example, the first configuration will be represented as 0001.
The goals are to 1) validate the configuration string; and 2) provide the configuration client the configuration values in the order required to successfully configure the barcode scanner.
Validation Conditions:
If a configuration string is not valid, return ["invalid configuration"].
Examples: Happy Path: configuration = "0002f7c22e7904|000176a3a4d214|000305d29f4a4b" Based on the "order" value, the expected output is: ["76a3a4d214", "f7c22e7904", "05d29f4a4b"]
Problem Statement: In this challenge, you are provided with an array of deployment results. Parse the data and determine the number of deployments that were successful or unsuccessful. Also test that the JSON input is valid based on the parameters listed below; otherwise, mark it as an error.
Return the result with the number of deployments that were successful, failed, or errors encountered parsing the data.
Function Description: Complete the evaluate_deployments function. evaluate_deployments has the following parameter:
Example Input:
[
{"deployment_id": "u-123456abcd", "status": "Success"},
{"deployment_id": "d-098765efgh", "status": "Fail"}
]
In this example, there is one in each category of success and fail with no input errors. This would return [1, 1, 0].
Returns: results[n]: an array of integers with the values of the deployment results: