wrote code for one facebook interview question, partition int array based on two integers