We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. Algorithms
  3. Search
  4. Task Scheduling
  5. Discussions

Task Scheduling

Problem
Submissions
Leaderboard
Discussions
Editorial
Topics

Sort 46 Discussions, By:

recency

Please Login in order to post a comment

  • wipenow059
    2 weeks ago+ 0 comments

    I like your task scheduling code. Can I integerate this algorithm on my website which is related account deletion

    0|
    Permalink
  • yashparihar729
    4 months ago+ 0 comments

    Here is my solution in java, javascript, python, C, C++, Csharp HackerRank Task Scheduling Problem Solution

    0|
    Permalink
  • juanmv94
    5 months ago+ 0 comments

    My C++ solution:

    map<int,int> mp = {{0,0}};                  //d->exceed
    map<int,int>::iterator maxdif = mp.begin();   //iterator to mp item with most exceed
    
    
    map<int,int>::iterator getIterator(int d) {
        if (d<=maxdif->first) return maxdif;
        auto iv = mp.insert({d,0});
        auto it =iv.first;
        if (iv.second) {    //new d;
            auto previt = it;
            previt--;
            it->second = previt->second+previt->first-it->first;
        }
        return it;
    }
    
    int taskScheduling(int d, int m) {
        map<int,int>::iterator it = getIterator(d);
        while (it!=mp.end()) {
            it->second += m;
            if (it->second > maxdif->second) {
                maxdif=it;
            }
            it++;
        }
        return maxdif->second;
    }
    
    0|
    Permalink
  • mineman1012221
    6 months ago+ 0 comments

    Here is the solution of Task Scheduling Click Here

    0|
    Permalink
  • eiduladh_a_wish1
    1 year ago+ 1 comment

    Can i integrate this challenge on my Scheduling website?

    0|
    Permalink
Load more conversations

Need Help?


View editorial
View top submissions
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy