826. Most Profit Assigning Work | count sort | max array | leetcode daily challenge | DSA | Hindi

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 มิ.ย. 2024
  • Problem Name:
    826. Most Profit Assigning Work
    Problem Statement:
    You have n jobs and m workers. You are given three arrays: difficulty, profit, and worker where:
    difficulty[i] and profit[i] are the difficulty and the profit of the ith job, and
    worker[j] is the ability of jth worker (i.e., the jth worker can only complete a job with difficulty at most worker[j]).
    Every worker can be assigned at most one job, but one job can be completed multiple times.
    For example, if three workers attempt the same job that pays $1, then the total profit will be $3. If a worker cannot complete any job, their profit is $0.
    Return the maximum profit we can achieve after assigning the workers to the jobs.
    Problem link:
    leetcode.com/problems/most-pr...
    Java Plus DSA Placement Course Playlist:
    • Java and DSA Course Pl...
    Java Plus DSA Sheet:
    docs.google.com/spreadsheets/...
    Notes:
    github.com/Tiwarishashwat/Jav...
    Telegram Link:
    shashwattiwari.page.link/tele...
    Ultimate Recursion Series Playlist:
    • Recursion and Backtrac...
    Instagram Handle: (@shashwat_tiwari_st)
    shashwattiwari.page.link/shas...
    Samsung Interview Experience:
    • I cracked Samsung | SR...
    Company Tags:
    Facebook | Amazon | Microsoft | Netflix | Google | LinkedIn | Pega Systems | VMware | Adobe | Samsung
    Timestamp:
    0:00 - Introduction
    #ShashwatTiwari #coding​​ #problemsolving​

ความคิดเห็น • 8

  • @dibakarbera1971
    @dibakarbera1971 12 วันที่ผ่านมา +1

    Thank you sir

  • @anirbandutta2266
    @anirbandutta2266 12 วันที่ผ่านมา

    Nice approach!

  • @PrakashRai-ff3pr
    @PrakashRai-ff3pr 12 วันที่ผ่านมา +3

    sir while solving question jo bhi approach aate hai aapke mind mai woh kese aate hai??aur hamare mai kab tak aa jayega like kuch specific topic tak hm cover kr lenge tab tak ya kuch aur....plz tell bahot help ho jayegi

    • @aryanarvind3733
      @aryanarvind3733 12 วันที่ผ่านมา +3

      I used to feel the same bro...kab mujhse solve hoga...easy leetocode questions bhi solve nhi hote hai khudse... medium or hard kese hoga etc etc
      What I found is that following a structured sheet of questions is very helpful. I am following strivers A2Z sheet
      It has easy, medium and hard questions of all the topics
      I used to solve easy and medium questions Jisme Dynamic programing ya koi fundamental topic esa na involved ho Jo mujhe nhi aata...for example mai agar ek array ka question solve kar rha hu toh I will follow sheet ka order to compound and build the concepts on the previously learnt concepts. Then question open karke sabse pehle usme kya topics involved hai wo dekhta hu jisse ki mujhe similar pattern find ya recall karne me easy rhe...then I look for the constraints too...Time complexity also helps ki approach kya honi chahiye also hints bhi helpful hote hai.
      First brute force try karta hu and test cases ke according code me changes karta hu
      Then I move to code optimisation
      Khud se sochta hu ki kya kar sakte hai
      And after 30 mins of deep observation if I am not able to optimise or find the exact solution then I look for the discussions tab for more hints and after this I look for solution videos.

    • @PrakashRai-ff3pr
      @PrakashRai-ff3pr 12 วันที่ผ่านมา +1

      @@aryanarvind3733 bhyii jo bhi tumne bola sach mai bahot help ful hai meri yhi galti hoti thi ki mai direct solution pe jump jar jata tha rather than koi hint pta karne k jisse mai code khud karu...but they way you r doing i will follow the same...thanks❤️...but hn sometimes easy problem bhi solve na hote to mak bhi yhi sochta hu ki medium kese solve karunga fir

    • @aryanarvind3733
      @aryanarvind3733 12 วันที่ผ่านมา

      ​@PrakashRai-ff3pr do not worry and do not hurry... trust the process bss just be consistent and keep revising the questions jo bhi solve karte ho. Hojayega sab 🙌

  • @RohitKumar-dz8dh
    @RohitKumar-dz8dh 12 วันที่ผ่านมา

    Thanks 😊