-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
217 lines (216 loc) · 1.44 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
let string =
`1650
1174
1156
1874
1958
1918
1980
1588
1863
1656
1843
1738
2001
1883
1941
1602
1881
1927
1284
1474
1942
1992
1925
1990
1831
1907
1914
1815
1921
1589
1224
1148
1223
935
1726
1828
1838
1611
1960
1668
1744
1566
1902
1203
1975
1225
2000
1678
1950
572
1812
1568
1484
1767
1509
1658
1127
1870
1098
1294
1310
1483
1865
1967
1856
1963
1929
1119
132
1969
1094
1523
1701
1896
1631
1956
1910
1672
1232
1285
1761
1649
1931
1959
1191
1846
1908
1976
1500
1940
1924
1521
1989
1635
1102
1114
1948
2007
1964
1926
1590
1900
1690
1880
1596
1395
1373
1937
1833
1845
1949
1128
1218
1928
1912
1893
1869
960
1813
1645
1490
1318
1934
1259
2005
1522
1270
1089
1674
1997
1112
1954
1769
1829
1814
1922
1904
1894
1595
1103
237
1943
1364
1906
1971
1998
1461
1606
1911
1545
1952
1917
1582
1994
1946
1935
1844
1938
1633
2004
1132
1530
1915
1982
1871
1852
1613
1476
1216
1834
1939
409
1895
1120
1194
1135
1899
1901
1439
485
1855
1136
200
1887
250
1930
1506
1945
1988
1170
1575
1872
1261
1137
1978
1537
1897
1837
1753
1913`
let stringSplit = string.split('\n');
let sum = 0;
let i = 0;
let product;
for (; i < stringSplit.length; i++){
for(let k = 0; k < stringSplit.length; k++){
sum = parseInt(stringSplit[i]) + parseInt(stringSplit[k]);
if (sum == 2020){
// console.log(stringSplit[i],stringSplit[k])
product = parseInt(stringSplit[i]) * parseInt(stringSplit[k]);
console.log(product);
// console.log(sum);
}
}
}