914 - Jumping Champion
Solution Description : Math Prime number problem pregenerate prime number up to 1000000 here exactly 78497 prime number between 2 to 1000000 input L & U find lower position(l) and upper position(u) in primeNum[] array for i=l+1 to u ----dif = primeNum[i]-primeNum[i-1] and increment count[dif]++ // In this problem the maximum dif is 114 so count array need 114 i.e. count[144] now find the maximum count from count[] array If maximum count contain more than 1 position then print "No jumping champion" else print which is contain the maximum position in count[] array |
||||||||||