Morgan Stanley Interview Question

in coding - coins related problem, dancer have to split the students equally where their absolute difference between them should be minimum.