def load_problem_details(id)
    return unless Problem[id].published.nil?

    html = open("https://projecteuler.net/problem=#{id}")
    fragment = Nokogiri::HTML(html)

    problem_info = fragment.css('div#problem_info span span')

    details = problem_info.text.split(';')
    Problem[id].published = details[0].strip
    Problem[id].solved_by = details[1].strip

    # recent problems do not have a difficult rating
    Problem[id].difficulty = details[2].strip if id <= Problem.total - 10
  end
def load_problem_details(id)
    return unless Problem[id].published.nil?

    html = open("https://projecteuler.net/problem=#{id}")
    fragment = Nokogiri::HTML(html)

    problem_info = fragment.css('div#problem_info span span')

    details = problem_info.text.split(';')
    Problem[id].published = details[0].strip
    Problem[id].solved_by = details[1].strip

    # recent problems do not have a difficult rating
    Problem[id].difficulty = details[2].strip if id <= Problem.total - 10
  end
Loads the details of an individual problem.