Approach hintTry it first, then revealHide
Sort both skill lists and sweep them with two pointers: pair a boy and a girl when their skills differ by at most one, otherwise advance the pointer with the smaller skill.
Sort both skill lists and sweep them with two pointers: pair a boy and a girl when their skills differ by at most one, otherwise advance the pointer with the smaller skill.