From 5053b3cbbde0aa1d4cdceee8f5d2ea73884ba741 Mon Sep 17 00:00:00 2001 From: ZennDev1337 Date: Tue, 14 Nov 2023 23:33:55 +0100 Subject: [PATCH] added skeleton for 2021 day1 in go --- 2021/day1/.idea/.gitignore | 8 + 2021/day1/.idea/day1.iml | 9 + 2021/day1/.idea/modules.xml | 8 + 2021/day1/.idea/vcs.xml | 6 + 2021/day1/data | 2000 +++++++++++++++++++++++++++++++++++ 2021/day1/go.mod | 3 + 2021/day1/main.go | 7 + 2021/day1/task.txt | 47 + 8 files changed, 2088 insertions(+) create mode 100644 2021/day1/.idea/.gitignore create mode 100644 2021/day1/.idea/day1.iml create mode 100644 2021/day1/.idea/modules.xml create mode 100644 2021/day1/.idea/vcs.xml create mode 100644 2021/day1/data create mode 100644 2021/day1/go.mod create mode 100644 2021/day1/main.go create mode 100644 2021/day1/task.txt diff --git a/2021/day1/.idea/.gitignore b/2021/day1/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/2021/day1/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/2021/day1/.idea/day1.iml b/2021/day1/.idea/day1.iml new file mode 100644 index 0000000..5e764c4 --- /dev/null +++ b/2021/day1/.idea/day1.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/2021/day1/.idea/modules.xml b/2021/day1/.idea/modules.xml new file mode 100644 index 0000000..94cf58a --- /dev/null +++ b/2021/day1/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/2021/day1/.idea/vcs.xml b/2021/day1/.idea/vcs.xml new file mode 100644 index 0000000..b2bdec2 --- /dev/null +++ b/2021/day1/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/2021/day1/data b/2021/day1/data new file mode 100644 index 0000000..21bf65a --- /dev/null +++ b/2021/day1/data @@ -0,0 +1,2000 @@ +184 +205 +211 +213 +227 +225 +224 +228 +232 +231 +217 +230 +231 +237 +250 +257 +256 +255 +260 +261 +250 +252 +243 +242 +240 +248 +253 +261 +262 +241 +227 +234 +235 +236 +237 +264 +267 +246 +249 +237 +258 +255 +257 +259 +253 +262 +263 +271 +252 +254 +249 +255 +258 +267 +278 +281 +282 +287 +298 +292 +282 +283 +286 +281 +274 +272 +268 +267 +272 +288 +293 +316 +348 +340 +337 +341 +344 +343 +358 +356 +358 +359 +364 +366 +365 +368 +384 +385 +393 +387 +388 +369 +376 +393 +395 +400 +401 +402 +401 +404 +382 +381 +385 +386 +411 +414 +419 +439 +438 +432 +437 +441 +434 +438 +439 +448 +452 +453 +456 +455 +458 +466 +471 +455 +462 +463 +467 +480 +483 +486 +485 +514 +522 +521 +520 +544 +550 +552 +544 +540 +542 +550 +554 +557 +556 +565 +560 +561 +569 +572 +576 +575 +578 +597 +589 +591 +587 +584 +587 +622 +623 +624 +627 +623 +624 +623 +624 +617 +622 +628 +629 +633 +639 +643 +635 +654 +655 +658 +664 +680 +699 +701 +700 +702 +706 +705 +691 +697 +695 +697 +682 +686 +692 +709 +711 +712 +714 +713 +706 +707 +728 +730 +729 +732 +737 +742 +756 +755 +757 +759 +762 +761 +769 +772 +764 +763 +776 +783 +787 +790 +793 +804 +805 +810 +812 +811 +818 +819 +823 +819 +825 +819 +822 +824 +826 +804 +814 +818 +814 +795 +801 +794 +805 +806 +803 +823 +815 +814 +821 +819 +821 +822 +820 +813 +826 +824 +819 +816 +815 +816 +813 +823 +822 +832 +829 +830 +837 +847 +810 +806 +809 +812 +813 +815 +825 +824 +825 +861 +858 +877 +857 +856 +852 +857 +856 +860 +864 +863 +869 +874 +873 +879 +884 +885 +871 +869 +871 +866 +863 +864 +861 +859 +861 +862 +868 +867 +875 +869 +872 +871 +857 +848 +849 +853 +854 +850 +849 +840 +842 +840 +847 +853 +848 +863 +867 +874 +872 +869 +860 +863 +880 +903 +915 +918 +914 +915 +912 +913 +914 +909 +913 +914 +924 +942 +941 +922 +919 +918 +919 +921 +922 +923 +921 +902 +909 +914 +915 +914 +913 +901 +889 +891 +920 +926 +927 +932 +922 +921 +920 +928 +937 +925 +924 +922 +934 +933 +917 +922 +926 +918 +917 +943 +947 +957 +955 +954 +953 +938 +906 +911 +947 +948 +949 +950 +934 +919 +920 +921 +923 +946 +939 +940 +947 +946 +961 +962 +970 +982 +983 +988 +999 +996 +1016 +1007 +998 +1008 +1007 +1000 +1008 +1012 +1032 +1023 +1041 +1046 +1047 +1037 +1039 +1044 +1052 +1055 +1054 +1058 +1055 +1053 +1041 +1043 +1051 +1043 +1045 +1044 +1035 +1051 +1049 +1054 +1053 +1055 +1064 +1063 +1088 +1092 +1087 +1090 +1087 +1103 +1099 +1096 +1097 +1096 +1101 +1087 +1094 +1096 +1070 +1071 +1075 +1072 +1073 +1074 +1079 +1067 +1058 +1056 +1052 +1053 +1057 +1059 +1069 +1070 +1074 +1090 +1091 +1088 +1065 +1066 +1061 +1062 +1091 +1097 +1100 +1099 +1110 +1139 +1137 +1138 +1116 +1110 +1112 +1118 +1111 +1131 +1132 +1130 +1131 +1142 +1140 +1150 +1146 +1172 +1174 +1183 +1187 +1197 +1192 +1198 +1212 +1211 +1212 +1214 +1213 +1211 +1226 +1218 +1215 +1185 +1205 +1207 +1199 +1216 +1205 +1211 +1199 +1200 +1201 +1206 +1244 +1228 +1236 +1246 +1249 +1248 +1243 +1240 +1237 +1235 +1242 +1244 +1234 +1228 +1244 +1236 +1237 +1236 +1237 +1236 +1239 +1240 +1239 +1236 +1245 +1241 +1246 +1267 +1272 +1280 +1282 +1286 +1288 +1286 +1314 +1315 +1312 +1326 +1316 +1315 +1321 +1324 +1289 +1282 +1267 +1271 +1267 +1264 +1287 +1292 +1295 +1299 +1316 +1319 +1305 +1302 +1312 +1303 +1317 +1324 +1323 +1346 +1345 +1364 +1344 +1369 +1372 +1374 +1375 +1376 +1373 +1387 +1388 +1393 +1392 +1393 +1367 +1379 +1381 +1375 +1379 +1365 +1369 +1372 +1374 +1377 +1365 +1364 +1371 +1370 +1369 +1363 +1354 +1335 +1334 +1341 +1345 +1351 +1355 +1359 +1348 +1349 +1344 +1362 +1361 +1367 +1370 +1360 +1366 +1384 +1385 +1384 +1380 +1378 +1381 +1378 +1377 +1368 +1363 +1378 +1376 +1371 +1361 +1370 +1375 +1386 +1387 +1376 +1377 +1375 +1376 +1375 +1376 +1377 +1382 +1383 +1385 +1404 +1423 +1422 +1419 +1425 +1428 +1427 +1431 +1432 +1431 +1451 +1450 +1459 +1461 +1467 +1466 +1462 +1455 +1438 +1443 +1442 +1447 +1443 +1450 +1469 +1483 +1479 +1477 +1464 +1445 +1447 +1452 +1459 +1458 +1457 +1463 +1462 +1465 +1464 +1468 +1472 +1474 +1475 +1479 +1477 +1511 +1512 +1515 +1513 +1534 +1537 +1534 +1535 +1530 +1532 +1521 +1520 +1524 +1520 +1522 +1535 +1500 +1499 +1494 +1495 +1500 +1514 +1510 +1509 +1511 +1499 +1494 +1517 +1515 +1508 +1509 +1508 +1503 +1498 +1493 +1492 +1494 +1524 +1523 +1522 +1523 +1517 +1515 +1524 +1542 +1544 +1557 +1554 +1556 +1554 +1557 +1525 +1520 +1518 +1522 +1532 +1531 +1522 +1532 +1534 +1538 +1533 +1553 +1558 +1543 +1548 +1554 +1555 +1556 +1547 +1554 +1576 +1580 +1581 +1565 +1567 +1566 +1607 +1611 +1610 +1612 +1618 +1615 +1613 +1615 +1620 +1616 +1624 +1617 +1625 +1648 +1653 +1660 +1659 +1658 +1689 +1690 +1684 +1726 +1721 +1715 +1718 +1695 +1690 +1685 +1713 +1717 +1713 +1701 +1710 +1708 +1707 +1706 +1709 +1718 +1716 +1721 +1713 +1707 +1708 +1711 +1716 +1718 +1712 +1714 +1713 +1702 +1738 +1745 +1738 +1764 +1756 +1759 +1755 +1739 +1736 +1747 +1783 +1777 +1763 +1762 +1766 +1767 +1745 +1749 +1748 +1750 +1738 +1766 +1759 +1760 +1761 +1762 +1759 +1752 +1742 +1744 +1745 +1740 +1738 +1739 +1742 +1754 +1737 +1724 +1725 +1738 +1769 +1775 +1780 +1776 +1777 +1779 +1781 +1776 +1775 +1773 +1772 +1774 +1775 +1778 +1758 +1754 +1751 +1736 +1741 +1743 +1742 +1736 +1763 +1765 +1774 +1776 +1777 +1773 +1774 +1791 +1785 +1786 +1787 +1789 +1790 +1795 +1807 +1816 +1824 +1820 +1823 +1825 +1824 +1823 +1822 +1830 +1842 +1854 +1853 +1852 +1857 +1853 +1848 +1841 +1831 +1818 +1823 +1842 +1844 +1845 +1849 +1854 +1866 +1861 +1869 +1873 +1879 +1887 +1890 +1881 +1896 +1897 +1903 +1904 +1908 +1905 +1913 +1923 +1920 +1922 +1921 +1912 +1904 +1907 +1908 +1911 +1920 +1916 +1917 +1926 +1927 +1924 +1926 +1934 +1937 +1941 +1923 +1902 +1900 +1898 +1923 +1922 +1944 +1961 +1967 +1974 +1977 +1975 +1977 +1972 +2008 +2006 +2005 +2006 +2016 +2015 +2000 +2001 +2011 +2013 +2014 +2013 +2016 +2023 +2042 +2053 +2033 +2042 +2041 +2035 +2041 +2045 +2038 +2033 +2038 +2040 +2042 +2017 +2022 +2025 +2026 +2028 +2027 +2029 +2011 +2008 +2013 +1990 +1996 +1997 +1994 +1991 +1999 +1989 +1988 +1974 +1996 +2007 +2005 +2006 +1975 +1967 +1964 +1958 +1948 +1950 +1952 +1951 +1956 +1988 +1987 +1986 +1987 +1985 +1968 +2009 +2004 +2005 +2006 +2017 +2016 +2046 +2045 +2047 +2052 +2053 +2069 +2053 +2050 +2079 +2093 +2097 +2084 +2083 +2090 +2064 +2057 +2055 +2068 +2074 +2062 +2069 +2070 +2071 +2077 +2071 +2083 +2113 +2119 +2122 +2123 +2111 +2103 +2098 +2102 +2109 +2103 +2091 +2098 +2099 +2098 +2101 +2102 +2108 +2120 +2117 +2121 +2133 +2135 +2139 +2136 +2128 +2125 +2126 +2119 +2137 +2153 +2159 +2156 +2155 +2154 +2153 +2149 +2162 +2158 +2188 +2190 +2189 +2183 +2189 +2195 +2192 +2189 +2192 +2201 +2188 +2193 +2202 +2226 +2228 +2227 +2229 +2204 +2203 +2196 +2208 +2218 +2192 +2194 +2197 +2193 +2191 +2184 +2185 +2184 +2178 +2169 +2170 +2163 +2171 +2174 +2173 +2187 +2188 +2204 +2207 +2206 +2207 +2208 +2209 +2210 +2207 +2220 +2240 +2242 +2254 +2256 +2249 +2251 +2260 +2306 +2284 +2276 +2277 +2281 +2300 +2294 +2287 +2299 +2300 +2295 +2297 +2304 +2305 +2306 +2310 +2304 +2287 +2290 +2307 +2332 +2333 +2328 +2326 +2319 +2330 +2327 +2331 +2329 +2309 +2310 +2312 +2316 +2315 +2304 +2295 +2292 +2295 +2293 +2292 +2293 +2300 +2302 +2319 +2316 +2320 +2321 +2326 +2330 +2329 +2339 +2342 +2340 +2339 +2355 +2372 +2379 +2382 +2381 +2372 +2363 +2365 +2380 +2379 +2383 +2377 +2363 +2362 +2360 +2370 +2368 +2373 +2356 +2362 +2368 +2375 +2381 +2410 +2451 +2453 +2457 +2456 +2448 +2449 +2454 +2444 +2455 +2451 +2446 +2452 +2462 +2459 +2463 +2468 +2470 +2471 +2474 +2464 +2460 +2486 +2484 +2483 +2486 +2492 +2493 +2497 +2498 +2497 +2494 +2488 +2498 +2505 +2506 +2510 +2521 +2499 +2501 +2511 +2507 +2516 +2518 +2525 +2526 +2519 +2524 +2536 +2542 +2538 +2535 +2547 +2558 +2553 +2552 +2558 +2559 +2565 +2571 +2565 +2572 +2591 +2584 +2586 +2605 +2622 +2623 +2625 +2637 +2636 +2637 +2655 +2659 +2658 +2657 +2670 +2671 +2672 +2663 +2666 +2639 +2638 +2636 +2650 +2649 +2651 +2654 +2650 +2643 +2645 +2637 +2638 +2642 +2641 +2647 +2640 +2619 +2635 +2633 +2635 +2637 +2639 +2640 +2626 +2629 +2637 +2638 +2637 +2639 +2637 +2636 +2645 +2619 +2591 +2574 +2577 +2578 +2585 +2594 +2590 +2589 +2608 +2594 +2576 +2578 +2585 +2595 +2596 +2605 +2613 +2614 +2622 +2608 +2610 +2607 +2593 +2595 +2603 +2600 +2594 +2596 +2592 +2574 +2582 +2586 +2574 +2588 +2587 +2589 +2590 +2582 +2587 +2601 +2596 +2583 +2588 +2615 +2616 +2614 +2615 +2612 +2611 +2607 +2638 +2632 +2631 +2629 +2636 +2617 +2614 +2617 +2618 +2616 +2622 +2645 +2646 +2645 +2656 +2652 +2653 +2654 +2655 +2644 +2645 +2637 +2636 +2639 +2643 +2645 +2648 +2650 +2655 +2656 +2654 +2651 +2637 +2643 +2640 +2639 +2643 +2645 +2663 +2645 +2646 +2626 +2606 +2611 +2598 +2605 +2606 +2605 +2607 +2613 +2616 +2636 +2632 +2631 +2632 +2631 +2632 +2631 +2627 +2639 +2641 +2637 +2636 +2632 +2631 +2630 +2657 +2659 +2658 +2646 +2663 +2678 +2674 +2675 +2678 +2674 +2675 +2676 +2684 +2673 +2668 +2642 +2643 +2651 +2633 +2618 +2617 +2616 +2591 +2570 +2574 +2580 +2592 +2580 +2579 +2581 +2579 +2602 +2603 +2602 +2603 +2605 +2617 +2616 +2618 +2623 +2620 +2624 +2635 +2633 +2659 +2661 +2666 +2668 +2664 +2665 +2666 +2644 +2649 +2651 +2642 +2635 +2627 +2626 +2627 +2607 +2623 +2616 +2611 +2619 +2623 +2637 +2644 +2635 +2634 +2632 +2628 +2641 +2644 +2634 +2645 +2646 +2647 +2650 +2648 +2640 +2642 +2629 +2632 +2635 +2637 +2642 +2635 +2634 +2632 +2664 +2658 +2678 +2673 +2697 +2682 +2699 +2723 +2722 +2726 +2727 +2728 +2727 +2728 +2730 +2727 +2719 +2738 +2736 +2734 +2707 +2706 +2705 +2672 +2673 +2658 +2656 +2655 +2670 +2671 +2675 +2664 +2666 +2686 +2688 +2687 +2673 +2668 +2669 +2662 +2661 +2662 +2659 +2660 +2674 +2683 +2684 +2692 +2697 +2688 +2690 +2692 +2677 +2681 +2678 +2679 +2689 +2716 +2704 +2718 +2726 +2725 +2731 +2749 +2753 +2755 +2750 +2749 +2755 +2777 +2795 +2798 +2809 +2810 +2809 +2811 +2798 +2800 +2798 +2797 +2790 +2814 +2812 +2817 +2803 +2804 +2798 +2809 +2810 +2807 +2818 +2819 +2805 +2806 +2815 +2813 +2803 +2787 +2788 +2789 +2802 +2803 +2804 +2814 +2822 +2814 +2817 +2807 +2805 +2820 +2835 +2838 +2843 +2851 +2849 +2856 +2854 +2853 +2855 +2862 +2865 +2864 +2869 +2872 +2876 +2877 +2882 +2872 +2874 +2885 +2901 +2906 +2912 +2918 +2919 +2920 +2921 +2922 +2931 +2929 +2958 +2961 +2963 +2948 +2947 +2957 +2953 +2943 +2959 +2955 +2961 +2970 +2977 +2978 +2958 +2951 +2952 +2938 +2940 +2950 +2939 +2946 +2953 +2951 +2944 +2949 +2979 +2988 +2989 +2982 +2981 +2978 +2964 +2967 +2974 +2972 +2978 +2986 +2981 +2983 +2984 +2997 +3001 +3024 +3018 +3029 +3039 +3040 +3041 +3042 +3033 +3038 +3018 +3017 +3032 +3040 +3044 +3046 +3039 +3037 +3038 +3042 +3047 +3066 +3080 +3087 +3088 +3106 +3110 +3111 +3110 +3109 +3119 +3124 +3128 +3126 +3113 +3121 +3122 +3119 +3128 +3126 +3127 +3130 +3131 +3132 +3131 +3130 +3134 +3125 +3128 +3129 +3133 +3136 +3146 +3123 +3128 +3127 +3140 +3141 +3148 +3147 +3152 +3159 +3145 +3146 +3124 +3147 +3148 +3169 +3184 +3177 +3178 +3164 +3156 +3137 +3136 +3137 +3138 +3137 +3143 +3142 +3144 +3142 +3144 +3142 +3141 +3142 +3146 +3138 +3128 +3122 +3135 +3127 +3122 +3121 +3124 +3130 +3131 +3129 +3131 +3135 +3126 +3128 +3120 +3129 +3131 +3135 +3136 +3138 +3140 +3123 +3124 +3123 +3127 +3096 +3097 +3105 +3101 +3100 +3101 +3087 +3088 +3089 +3091 +3084 +3087 +3127 +3130 +3119 +3121 +3126 +3141 +3115 +3111 +3104 +3103 +3128 +3125 +3126 +3124 +3125 +3141 +3155 +3154 +3159 +3165 +3200 +3184 +3182 +3177 +3202 +3204 +3203 +3199 +3196 +3189 +3182 +3186 +3188 +3186 +3192 +3199 +3201 +3214 +3215 +3230 +3227 +3235 +3239 +3238 +3228 +3240 +3237 +3218 +3222 +3205 +3204 +3183 +3174 +3181 +3192 +3189 +3187 +3196 +3198 +3206 +3211 +3231 +3232 +3235 +3232 +3236 +3237 +3227 +3235 +3240 +3241 +3250 +3246 +3247 +3254 +3268 +3269 +3278 +3279 +3278 +3288 +3273 +3275 +3277 +3270 +3277 +3275 +3290 +3292 +3296 +3301 +3302 +3287 +3286 +3287 +3294 +3296 +3265 +3270 +3272 +3277 +3271 +3266 +3273 +3277 +3273 +3271 +3274 +3275 +3273 +3272 +3279 +3281 +3288 \ No newline at end of file diff --git a/2021/day1/go.mod b/2021/day1/go.mod new file mode 100644 index 0000000..fbd3597 --- /dev/null +++ b/2021/day1/go.mod @@ -0,0 +1,3 @@ +module day1 + +go 1.21 diff --git a/2021/day1/main.go b/2021/day1/main.go new file mode 100644 index 0000000..ae91452 --- /dev/null +++ b/2021/day1/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("hallo") +} diff --git a/2021/day1/task.txt b/2021/day1/task.txt new file mode 100644 index 0000000..359e714 --- /dev/null +++ b/2021/day1/task.txt @@ -0,0 +1,47 @@ +--- Day 1: Sonar Sweep --- + +You're minding your own business on a ship at sea when the overboard alarm goes off! You rush to see if you can help. Apparently, one of the Elves tripped and accidentally sent the sleigh keys flying into the ocean! + +Before you know it, you're inside a submarine the Elves keep ready for situations like this. It's covered in Christmas lights (because of course it is), and it even has an experimental antenna that should be able to track the keys if you can boost its signal strength high enough; there's a little meter that indicates the antenna's signal strength by displaying 0-50 stars. + +Your instincts tell you that in order to save Christmas, you'll need to get all fifty stars by December 25th. + +Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck! + +As the submarine drops below the surface of the ocean, it automatically performs a sonar sweep of the nearby sea floor. On a small screen, the sonar sweep report (your puzzle input) appears: each line is a measurement of the sea floor depth as the sweep looks further and further away from the submarine. + +For example, suppose you had the following report: + +199 +200 +208 +210 +200 +207 +240 +269 +260 +263 + +This report indicates that, scanning outward from the submarine, the sonar sweep found depths of 199, 200, 208, 210, and so on. + +The first order of business is to figure out how quickly the depth increases, just so you know what you're dealing with - you never know if the keys will get carried into deeper water by an ocean current or a fish or something. + +To do this, count the number of times a depth measurement increases from the previous measurement. (There is no measurement before the first measurement.) In the example above, the changes are as follows: + +199 (N/A - no previous measurement) +200 (increased) +208 (increased) +210 (increased) +200 (decreased) +207 (increased) +240 (increased) +269 (increased) +260 (decreased) +263 (increased) + +In this example, there are 7 measurements that are larger than the previous measurement. + +How many measurements are larger than the previous measurement? + +Answer: \ No newline at end of file