2037. Minimum Number of Moves to Seat Everyone | Greedy | Counting Sort

Поделиться
HTML-код
  • Опубликовано: 17 ноя 2024

Комментарии • 5

  • @harshitagupta3645
    @harshitagupta3645 5 месяцев назад +5

    your dedication and consistency >>>>> laptop khulte hi aaj k question ki video bhi aa jaati h.

  • @AnujB-d9l
    @AnujB-d9l 3 месяца назад

    what if seats = [0,1,2,3] & students = [1,2,3,4] will this alg stills works on this testcase

    • @AnujB-d9l
      @AnujB-d9l 3 месяца назад

      yes it really works, sorry for asking bro

  • @codebreaker6578
    @codebreaker6578 5 месяцев назад +1

    can't we do it using hashmap that will be same as taking arr[101]
    class Solution {
    public:
    int minMovesToSeat(vector& seats, vector& students) {
    multimapmp1;
    multimapmp2;
    for(int i=0;ifirst);
    it1++;
    it2++;
    }
    return sum;
    }
    };

  • @aggarwalsachin4854
    @aggarwalsachin4854 5 месяцев назад +2

    bhaii thoda clear bola krr