another variant of two sum