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. All Contests
  2. ProjectEuler+
  3. Project Euler #103: Special subset sums: optimum
  4. Discussions

Project Euler #103: Special subset sums: optimum

Problem
Submissions
Leaderboard
Discussions

Sort 11 Discussions, By:

votes

Please Login in order to post a comment

  • kitchent
    4 years ago+ 0 comments

    I don't know if it's just me, but the test cases for later problems are getting more annoying associated with minor issues of handling large numbers.

    Anyway, I've got an solution for this problem. To arrive at the answer skipping the unneccessary intermediate steps, generate a list of all 's at the beginning (and this is where Python fails on the server without modulo, but not on my machine). It can be achieved easily if you observe the cases for odd and even separately.

    After that, to get to the answer is just a matter of accumulating those 's. You are just one step away when you have the highest element of the answer.

    0|
    Permalink
  • rahulk5
    7 years ago+ 2 comments

    Time out for all test cases in java. Time complexity of my solution is O(n) and space complexity is O(n). Any help ?

    0|
    Permalink
  • vinay149
    7 years ago+ 1 comment

    what will be value of b in this question pls

    0|
    Permalink
  • ptk94
    7 years ago+ 2 comments

    For n=20: 166116 249216 290766 311562 321960 327170 329775 331083 331737 332067 332232 332316 332358 332380 332391 332397 332400 332402 332403 332404

    For n=100: 489471006, 479381980 ...

    For n=10000: 673939922, 26088258 ...

    For n=1000000: 459043758, 272140464 ...

    0|
    Permalink
  • dougdaly
    7 years ago+ 1 comment

    Seems to time out -- is this doable in Python?

    0|
    Permalink
Load more conversations

Need Help?


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