Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

  x = File.read('puzle.txt')
  y = x.split(/ \w /)
  module Enumerable
    def dups
      inject({}) {|h,v| h[v]=h[v].to_i+1; h}.reject{|k,v| v==1}.keys
     end
  end
  d = y.dups
  require 'mathn'
  dp = []
  d.each {|z| z = z.to_i; dp << z if z.prime?}
  dp


Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: