Code (PHP) pasted on 2018-11-18, 22:08 Raw Source
- <?php
- function mergeIntersectingArrays($input) {
- $r = new stdClass();
- $r->values = $e;
- $r->merged = false;
- $r->result = false;
- return $r;
- }, $input);
- $workElem = $workArray[$workKey];
- if ($workElem->merged) continue;
- $searchElem = $workArray[$searchKey];
- if ($searchElem->merged || ($searchKey == $workKey)) continue;
- $searchElem->merged = true;
- }
- }
- $workElem->result = true;
- }
- return $item->values;
- return $item->result && !$item->merged;
- })));
- }