You are given a grid of numbers. A snake sequence is made up of adjacent numbers such that for each number, the number on the right or the number below it is +1 or -1 its value.?
Given a set of numbers [1-N] . Find the number of subsets such that the sum of numbers in the subset is a prime number, in better than O(N^3)?