fork download
  1. y=function(x){s=strftime;b=ISOdate
  2. a=seq(b(x,1,1),t=b(x,12,31),b='d')
  3. length(a[s(a,'%u')==3&trimws(s(a,'%e'))%in%c(2,3,5,7,11,13,17,19,23,29,31)])}
  4.  
  5. # test cases
  6. sapply(c(1912,1914,1984,1996,2063,2150,2199,2233), y)
Success #stdin #stdout 0.3s 60752KB
stdin
Standard input is empty
stdout
[1] 19 16 17 19 19 16 18 18