✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
You are provided with a file named contamination_analysis.txt. This file contains details regarding a contamination analysis ( The process of finding unwanted chemical compounds in a certain material) carried out for a set of chemicals by a lab.
A set of chemical names and the molecular structure of the contaminant in each chemical is given in the file.
Example input file (contamination_analysis.txt) :
ABC/D/12 C6-H5-Cl3-NaDE/W/45 C7-S-O4-NaMLI/85/9 C6-H6-S-O3-MgQT/36/X C4-Cl3-O3-Cl3-O2AL/2T/B C2-N-H4-NaPP/L2/28 C6-S-O8-Na-H2-Cl3
Each line of the input file has a chemical name and the molecular formula of the contaminant found in the chemical ( ABC/D/12 is the chemical name, and C6-H5-Cl3-Na is the molecular formula for the contaminant in the chemical ABC/D/12 ).
The number of chemicals in an input file can vary. The example input file has details regarding 6 chemicals but the input files in test cases can have up to 10 chemicals in a file.
You need to categorize each chemical in the input files based on the contaminant in the chemical. The following criteria should be followed for categorizing chemicals.
Criteria:The chemical is categorized as ‘Level_1’ if the contaminant contains;
The chemical is categorized as ‘Level_2’ if the contaminant contains;
Note : When categorizing, give priority to the order of the criteria.
Ex: If the contaminant has (C6-S-O3-Na-O2-Mg)
Then the category is Level_1. Because after we categorized it to Level_1 the left molecules are
Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!