The correct option is C Magnesium
Since here the elements are from two groups (group1 and group 2), we can simplify the question by finding the least metallic element from the given groups and then comparing them. Among the given elements, sodium and potassium belong to group 1. The metallic characteristics increase down a group and since in group 1, sodium is the element that is present above potassium, it has the least metallic character than potassium. Similarly in group 2 magnesium has the least metallic character when compared to calcium.
Now, sodium and magnesium belong to the same period and the metallic characteristics decrease along a period. Therefore, magnesium has the least metallic character among the given options.