there donut shop bake donut batch batchsize they rule serve donut batch serve donut batch you give integer batchsize integer array group groupsi denote group groupsi customer visit shop each customer exactly donutWhen group visit shop customer group serve serve follow group a group happy fresh donut that customer group receive donut leave previous groupyou freely rearrange ordering group return maximum possible number happy group rearrange group Example 1input batchsize 3 group 123456output 4explanation you arrange group 624513 then 1st 2nd 4th 6th group happyExample 2input batchsize 4 group 13252216output 4 constraints1 batchSize 91 groupslength 301 groupsi 109