Verdis Interview Question

Write a optimized code for checking a number as prime