Find the brands you love at prices that work for you with a TJX gift card! Our buyers negotiate amazing deals with top designers and pass the savings to you. Departments include apparel, shoes, home, beauty, and accessories. The TJX gift card is redeemable at over 3200 T. J. Maxx, Marshalls, HomeGoods, Homesense and Sierra (in the U. S. and Puerto Rico) and online at tjmaxx. com, sierra. com and marshalls. com.
To solve this problem, we need to reformat system requirements from a given input into a structured HTML output. The input consists of an array of objects, where each object represents system requirements for a different operating system (OS). Each object contains a "system" key and a "requirement" key, with the requirement being an HTML string of system specifications.
### Approach
The approach involves the following steps:
1. **Parse the Input**: Loop through each object in the input array.
2. **Create Containers**: For each system, create a container div with the class "prod-spec".
3. **Add Headings and Paragraphs**: Insert a heading and a paragraph for "MINIMUM SPECS".
4. **Process HTML Requirements**: Parse the HTML string from the "requirement" key to extract each specification.
5. **Extract Key-Value Pairs**: For each list item in the parsed HTML, extract the key (from a strong tag) and the corresponding value.
6. **Reformat HTML**: Structure each extracted specification into a new list item, ensuring proper formatting with a span for the key.
7. **Combine Results**: Assemble all containers and their specifications into the final HTML string.
### Solution Code
```html
Windows System Requirements
MINIMUM SPECS
-
OS: Windows 7 or higher
-
Processor: 1.5 GHz
-
Memory: 2 GB RAM
-
Graphics: 256MB DirectX 9 or higher
-
Storage: 1 GB available space
-
Additional Notes: A printed copy of the Bomb Defusal Manual or an additional web-enabled device to view the Bomb Defusal Manual is required. The Bomb Defusal Manual is freely available at www.bombmanual.com. HTC Vive or Oculus Rift/DK2 required for VR play. Gamepad or motion controllers required for VR play.
Mac System Requirements
MINIMUM SPECS
-
OS: OS X 10.9 (Mavericks) or later
-
Processor: 1.5 GHz Intel Processor
-
Graphics: 256MB or higher
-
Storage: 1 GB available space
-
Additional Notes: A printed copy of the Bomb Defusal Manual or an additional web-enabled device to view the Bomb Defusal Manual is required. The Bomb Defusal Manual is freely available at www.bombmanual.com. Virtual reality not supported.
Linux System Requirements
MINIMUM SPECS
-
OS: Ubuntu 16.04 or later
-
Processor: 1.5 GHz Intel Processor
-
Graphics: 256MB or higher
-
Additional Notes: A printed copy of the Bomb Defusal Manual or an additional web-enabled device to view the Bomb Defusal Manual is required. The Bomb Defusal Manual is freely available at www.bombmanual.com. Virtual reality not supported.
```
### Explanation
The code processes each system's requirements by converting them into a structured HTML format. Each system's specifications are encapsulated within a div, ensuring a clean and organized layout. The key specifications are highlighted using spans, making them stand out, while the values follow immediately for clarity. This approach ensures that the system requirements are presented in an easy-to-read and well-structured manner, adhering to the specified format.
分享