Browse Source

First part of first question

Petra Lamborn 1 year ago
parent
commit
d65414981f
3 changed files with 209 additions and 0 deletions
  1. 1
    0
      .gitignore
  2. 8
    0
      1a.R
  3. 200
    0
      input1a.csv

+ 1
- 0
.gitignore View File

@@ -47,3 +47,4 @@ vignettes/*.pdf
47 47
 *.utf8.md
48 48
 *.knit.md
49 49
 
50
+.secretcode

+ 8
- 0
1a.R View File

@@ -0,0 +1,8 @@
1
+input <- read.csv("input1a.csv", header=F)[[1]]
2
+
3
+alt <- 2020 - input
4
+
5
+vals <- input[input %in% alt]
6
+vals
7
+# 719796
8
+vals[1] * vals[2]

+ 200
- 0
input1a.csv View File

@@ -0,0 +1,200 @@
1
+1742
2
+1763
3
+1238
4
+1424
5
+1736
6
+1903
7
+1580
8
+1847
9
+1860
10
+1933
11
+1779
12
+1901
13
+1984
14
+1861
15
+1769
16
+1896
17
+1428
18
+2010
19
+1673
20
+1491
21
+1996
22
+1746
23
+1973
24
+1696
25
+1616
26
+2006
27
+1890
28
+1600
29
+1991
30
+1724
31
+1804
32
+1794
33
+462
34
+1706
35
+2002
36
+1939
37
+1834
38
+1312
39
+1943
40
+1465
41
+1405
42
+1459
43
+1659
44
+1288
45
+1241
46
+1935
47
+1294
48
+1388
49
+1772
50
+1945
51
+1649
52
+813
53
+1956
54
+1274
55
+1686
56
+1404
57
+1770
58
+1631
59
+1366
60
+1321
61
+1353
62
+1685
63
+1365
64
+1738
65
+1911
66
+1235
67
+1495
68
+1837
69
+1456
70
+1283
71
+1929
72
+1326
73
+1735
74
+1604
75
+1223
76
+1261
77
+1844
78
+1850
79
+1429
80
+277
81
+1848
82
+1818
83
+1395
84
+1522
85
+1863
86
+1475
87
+1562
88
+1351
89
+1538
90
+1313
91
+1416
92
+1690
93
+1539
94
+1338
95
+1982
96
+1297
97
+1821
98
+780
99
+1859
100
+1420
101
+1934
102
+1303
103
+1731
104
+1714
105
+1702
106
+1417
107
+1872
108
+1998
109
+1908
110
+1957
111
+1270
112
+1359
113
+1760
114
+1997
115
+1773
116
+2000
117
+1203
118
+1880
119
+1955
120
+1273
121
+1775
122
+1893
123
+1237
124
+1707
125
+1885
126
+1900
127
+1801
128
+1367
129
+1561
130
+1524
131
+1678
132
+1511
133
+1623
134
+1464
135
+1477
136
+1733
137
+1423
138
+1575
139
+1851
140
+2007
141
+1651
142
+804
143
+1836
144
+1849
145
+1713
146
+1401
147
+1502
148
+1806
149
+1506
150
+1646
151
+1968
152
+1253
153
+1889
154
+1759
155
+1734
156
+1611
157
+1558
158
+1256
159
+1657
160
+1778
161
+1953
162
+1578
163
+1717
164
+1498
165
+1381
166
+1919
167
+1512
168
+1391
169
+384
170
+1802
171
+1573
172
+1940
173
+1323
174
+2003
175
+1689
176
+1936
177
+1368
178
+1962
179
+1964
180
+1586
181
+1619
182
+1482
183
+1445
184
+372
185
+1792
186
+96
187
+1468
188
+1999
189
+1301
190
+1757
191
+1613
192
+1807
193
+1941
194
+1642
195
+1557
196
+1884
197
+1626
198
+489
199
+1989
200
+1327