Skip to main content
2 of 6
added 9 characters in body
Level River St
  • 28.8k
  • 4
  • 40
  • 112

#C, trial division, 75 #

i=1; main(n){for(scanf("%d",&n);n%i++&&i<n;);printf("%d",n<3?n-1:n%i);} 

Note special handling for n=1,2

Level River St
  • 28.8k
  • 4
  • 40
  • 112