Ad
  • Custom User Avatar

    Thank you, Abbe! Good points. I added an extra test case line to the bottom of my description, and I now explain that you need to create 2 to_a methods, a class and instance method. Yes, it's useful to implement basic data structures from scratch, instead of depending on a library/gem. That fact that Ruby doesn't have a built-in linked list is bad for programmers but good for us learners.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I'm rayning3 on Skype, if you want to talk. If you have any questions about Ruby, I've been programming in it for over 1 year now. My email is rayning@gmail.com. I'm happy to help! What's your new job? Congratulations.

  • Custom User Avatar

    C'mon, Kasare12. You shouldn't use a gem (someone else's code) to make primes. Figure out an algorithm to create your own. If you are using a gem, you can't modify the code internally. Also, this problem goes up to a big number, on purpose. The basic brute force way of finding primes won't work. You need to find a faster, more efficient way. Project Euler (https://projecteuler.net/) does the same thing. They always ask you to find something that may be simple if done for a small case. But then you must solve it for a 100 digit number (or more). Brute force usually won't work.

  • Custom User Avatar

    Sure, Kasare12. How may I see your code to check it?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Same here. So frustrating. I keep passing the first 5 tests but failing the last 2. Can someone give us a hint about the tree size in the last 2 tests, or what the final test results for the last 2 tests should look like? I am stuck.

  • Custom User Avatar

    Problem should say what the max primes are that it tests up to.