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
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. Prepare
  2. Algorithms
  3. Greedy
  4. Jim and the Orders
  5. Discussions

Jim and the Orders

Problem
Submissions
Leaderboard
Discussions
Editorial

    You are viewing a single comment's thread. Return to all comments →

  • patrick_garvey
    4 years ago+ 2 comments

    def jimOrders(orders): serve_time = []

    for i, v in enumerate(orders):
        serve_time.append([v[0]+v[1],i+1])
    
    serve_time.sort()
    order = [x[1] for x in serve_time]
    return order
    

    my solution in python 3, pretty simple

    7|
    Permalink
  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature