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
  • Apply
  • Hiring developers?
  1. Prepare
  2. Algorithms
  3. Search
  4. King Richard's Knights
  5. Discussions

King Richard's Knights

Problem
Submissions
Leaderboard
Discussions
Editorial

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

  • Abzollo
    7 years ago+ 0 comments

    if you're solving this problem in O(N^2), you're not even close. You can solve this problem in O(L*S), but that's still not fast enough, not even for a single test case (except sample). Honestly I just gave up and looked up the editorial. You have to do binary search somewhere. sigh

    8|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy