Neiron Interview Question

core java,Prime number code with 0(1) time complexity