


Implement the closestRelative function so that when a parent HTML element is passed, the function returns the parent's closest relative whose name matches the relativeName, and obeys the following rules: The following HTML represents a family tree:

Implement the simulate function so that the malware behavior is replicated for further study. In this example, number 2 was removed because 40 is the bigger number. The expected values after the malware runs are: For example, if the values in a record file are the following: The malware finds all the positions first and only then sets them to 0. If the 'X' position is near the left or right border and has no 'T' position neighbor, only one side is considered. Positions further beyond the 'T's, to the far left or far right, are also ignored. Positions '_' represent neighbors that are ignored. The record is replaced by 0 when it is smaller or equal to either of those neighbors.įor each number, it matches the following pattern, where position 'X', is compared to positions 'T': T, _, _, X, _, _, _, T The malware checks the value of each record and the values of some of its neighbors. Your company is analyzing malware software which targets numerical record files.
