More than n value cannot be printed in O(n)