you give array people peoplei weight ith person infinite number boat boat carry maximum weight limit each boat carry people time provide sum weight people limitreturn minimum number boat carry give person example 1input people 12 limit 3output 1explanation 1 boat 1 2example 2input people 3221 limit 3output 3explanation 3 boat 1 2 2 3example 3input people 3534 limit 5output 4explanation 4 boat 3 3 4 5 constraints1 peoplelength 5 1041 peoplei limit 3 104