# Here your code ! primes = (2..10000).to_a (2..100).each do |i| primes.reject!{ |v| (v % i == 0) && (i != v) } end n = 5 dp = Array.new(n,false) dp[0] = true dp[1] = true (2..n).each do |i| dp[i] = primes.reject{|j| j > i }.any?{|j| dp[i - j] == false} end puts dp[n] ? "Win" : "Lose"