How to split foreach in 2 parts

Is it possible to split a foreach in two parts?
For example: 50% of the items in group-1 and 50% of the items in group-2

<div class="group-1">
<?php $items = $page->brands_items()->toStructure(); foreach ($items as $item): ?>
<?= $item->title() ?>
<?php endforeach ?>
</div>

<div class="group-2">
<?php $items = $page->brands_items()->toStructure(); foreach ($items as $item): ?>
<?= $item->title() ?>
<?php endforeach ?>
</div>
  • Count the number of items $count = $page->brands_items()->toStructure()->count();
  • Divide by 2 and round to next int
  • Use chunk() to create chunks of $count size