{"id":1714,"date":"2024-12-12T17:05:23","date_gmt":"2024-12-12T17:05:23","guid":{"rendered":"https:\/\/code.efi.ohmportal.de\/blog\/?p=1714"},"modified":"2024-12-15T13:12:30","modified_gmt":"2024-12-15T13:12:30","slug":"advent-of-code-2024","status":"publish","type":"post","link":"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/","title":{"rendered":"Advent of Code 2024"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Tag 12 &#8211; Gartengruppen<\/h3>\n\n\n\n<p>Auch dieses Jahr macht der <a href=\"https:\/\/adventofcode.com\/\">Adventskalender f\u00fcr Programmierer <\/a>Spa\u00df. Ganz ohne Verkn\u00fcpfung mit einer Lehrveranstaltung oder einem Fakult\u00e4ts-Leaderboard ist es diesmal ganz entspannt.<\/p>\n\n\n\n<p>Am <strong>Tag 12<\/strong> geht es darum, den Elfen beim Einz\u00e4unen von Beeten zu helfen. Ein Beet enth\u00e4lt immer genau eine Pflanzensorte. Die Lage der Pflanzen ist in Form eines gro\u00dfen Buchstabensalats gegeben &#8211; 140 Zeilen mit jeweils 140 Zeichen. Jeder Buchstabe steht f\u00fcr eine Pflanzensorte. Die erste Herausforderung besteht darin, effizient die Beete zu identifizieren.<\/p>\n\n\n\n<p>Eine schicke M\u00f6glichkeit ist es, jede einzelne Pflanze zun\u00e4chst als eigenes Beet zu sehen und anschlie\u00dfend benachbarte Pflanzen gleicher Sorte zu vereinen. Mit einem <a href=\"https:\/\/www.geeksforgeeks.org\/introduction-to-disjoint-set-data-structure-or-union-find-algorithm\/\">UNION-FIND-Algorithmus<\/a> l\u00e4sst sich beides jeweils in linearer Zeit erledigen.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"1280\" style=\"aspect-ratio: 748 \/ 1280;\" width=\"748\" autoplay controls loop muted src=\"https:\/\/code.efi.ohmportal.de\/blog\/wp-content\/uploads\/2024\/12\/AOC24D12.mp4\"><\/video><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Tag 12 &#8211; Gartengruppen Auch dieses Jahr macht der Adventskalender f\u00fcr Programmierer Spa\u00df. Ganz ohne Verkn\u00fcpfung mit einer Lehrveranstaltung oder einem Fakult\u00e4ts-Leaderboard ist es diesmal ganz entspannt. Am Tag 12 geht es darum, den Elfen beim Einz\u00e4unen von Beeten zu helfen. Ein Beet enth\u00e4lt immer genau eine Pflanzensorte. Die Lage der Pflanzen ist in Form &hellip; <a href=\"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/\" class=\"more-link\"><span class=\"screen-reader-text\">Advent of Code 2024<\/span> weiterlesen<\/a><\/p>\n","protected":false},"author":2,"featured_media":1666,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[11],"tags":[42],"class_list":["post-1714","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-coding","tag-advent-of-code"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Advent of Code 2024 - Code Comments<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Advent of Code 2024 - Code Comments\" \/>\n<meta property=\"og:description\" content=\"Tag 12 &#8211; Gartengruppen Auch dieses Jahr macht der Adventskalender f\u00fcr Programmierer Spa\u00df. Ganz ohne Verkn\u00fcpfung mit einer Lehrveranstaltung oder einem Fakult\u00e4ts-Leaderboard ist es diesmal ganz entspannt. Am Tag 12 geht es darum, den Elfen beim Einz\u00e4unen von Beeten zu helfen. Ein Beet enth\u00e4lt immer genau eine Pflanzensorte. Die Lage der Pflanzen ist in Form &hellip; Advent of Code 2024 weiterlesen\" \/>\n<meta property=\"og:url\" content=\"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/\" \/>\n<meta property=\"og:site_name\" content=\"Code Comments\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-12T17:05:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-15T13:12:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/code.efi.ohmportal.de\/blog\/wp-content\/uploads\/2022\/12\/aoC.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"417\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Oliver Hofmann\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Oliver Hofmann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\u00a0Minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/\"},\"author\":{\"name\":\"Oliver Hofmann\",\"@id\":\"https:\/\/code.efi.ohmportal.de\/blog\/#\/schema\/person\/cd22585e9c447d5140fab876575fc394\"},\"headline\":\"Advent of Code 2024\",\"datePublished\":\"2024-12-12T17:05:23+00:00\",\"dateModified\":\"2024-12-15T13:12:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/\"},\"wordCount\":125,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code.efi.ohmportal.de\/blog\/wp-content\/uploads\/2022\/12\/aoC.jpg\",\"keywords\":[\"Advent of Code\"],\"articleSection\":[\"Coding\"],\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/\",\"url\":\"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/\",\"name\":\"Advent of Code 2024 - Code Comments\",\"isPartOf\":{\"@id\":\"https:\/\/code.efi.ohmportal.de\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code.efi.ohmportal.de\/blog\/wp-content\/uploads\/2022\/12\/aoC.jpg\",\"datePublished\":\"2024-12-12T17:05:23+00:00\",\"dateModified\":\"2024-12-15T13:12:30+00:00\",\"author\":{\"@id\":\"https:\/\/code.efi.ohmportal.de\/blog\/#\/schema\/person\/cd22585e9c447d5140fab876575fc394\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/#primaryimage\",\"url\":\"https:\/\/code.efi.ohmportal.de\/blog\/wp-content\/uploads\/2022\/12\/aoC.jpg\",\"contentUrl\":\"https:\/\/code.efi.ohmportal.de\/blog\/wp-content\/uploads\/2022\/12\/aoC.jpg\",\"width\":1000,\"height\":417,\"caption\":\"Advent of Code @ EFI\"},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/code.efi.ohmportal.de\/blog\/#website\",\"url\":\"https:\/\/code.efi.ohmportal.de\/blog\/\",\"name\":\"Code Comments\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/code.efi.ohmportal.de\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/code.efi.ohmportal.de\/blog\/#\/schema\/person\/cd22585e9c447d5140fab876575fc394\",\"name\":\"Oliver Hofmann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/code.efi.ohmportal.de\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b0d136459d060e391d2d3cc30a86b2bd4bb87d7358a51931de0a12ddd4f2f2bb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b0d136459d060e391d2d3cc30a86b2bd4bb87d7358a51931de0a12ddd4f2f2bb?s=96&d=mm&r=g\",\"caption\":\"Oliver Hofmann\"},\"sameAs\":[\"http:\/\/www.welearn.de\/fakultaet-iw\/personen\/details\/person\/prof-dr-oliver-hofmann\/\"],\"url\":\"https:\/\/code.efi.ohmportal.de\/blog\/author\/hofmanno\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Advent of Code 2024 - Code Comments","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/","og_locale":"de_DE","og_type":"article","og_title":"Advent of Code 2024 - Code Comments","og_description":"Tag 12 &#8211; Gartengruppen Auch dieses Jahr macht der Adventskalender f\u00fcr Programmierer Spa\u00df. Ganz ohne Verkn\u00fcpfung mit einer Lehrveranstaltung oder einem Fakult\u00e4ts-Leaderboard ist es diesmal ganz entspannt. Am Tag 12 geht es darum, den Elfen beim Einz\u00e4unen von Beeten zu helfen. Ein Beet enth\u00e4lt immer genau eine Pflanzensorte. Die Lage der Pflanzen ist in Form &hellip; Advent of Code 2024 weiterlesen","og_url":"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/","og_site_name":"Code Comments","article_published_time":"2024-12-12T17:05:23+00:00","article_modified_time":"2024-12-15T13:12:30+00:00","og_image":[{"width":1000,"height":417,"url":"https:\/\/code.efi.ohmportal.de\/blog\/wp-content\/uploads\/2022\/12\/aoC.jpg","type":"image\/jpeg"}],"author":"Oliver Hofmann","twitter_misc":{"Verfasst von":"Oliver Hofmann","Gesch\u00e4tzte Lesezeit":"1\u00a0Minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/#article","isPartOf":{"@id":"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/"},"author":{"name":"Oliver Hofmann","@id":"https:\/\/code.efi.ohmportal.de\/blog\/#\/schema\/person\/cd22585e9c447d5140fab876575fc394"},"headline":"Advent of Code 2024","datePublished":"2024-12-12T17:05:23+00:00","dateModified":"2024-12-15T13:12:30+00:00","mainEntityOfPage":{"@id":"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/"},"wordCount":125,"commentCount":0,"image":{"@id":"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/#primaryimage"},"thumbnailUrl":"https:\/\/code.efi.ohmportal.de\/blog\/wp-content\/uploads\/2022\/12\/aoC.jpg","keywords":["Advent of Code"],"articleSection":["Coding"],"inLanguage":"de","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/","url":"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/","name":"Advent of Code 2024 - Code Comments","isPartOf":{"@id":"https:\/\/code.efi.ohmportal.de\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/#primaryimage"},"image":{"@id":"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/#primaryimage"},"thumbnailUrl":"https:\/\/code.efi.ohmportal.de\/blog\/wp-content\/uploads\/2022\/12\/aoC.jpg","datePublished":"2024-12-12T17:05:23+00:00","dateModified":"2024-12-15T13:12:30+00:00","author":{"@id":"https:\/\/code.efi.ohmportal.de\/blog\/#\/schema\/person\/cd22585e9c447d5140fab876575fc394"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/"]}]},{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/code.efi.ohmportal.de\/blog\/2024\/12\/advent-of-code-2024\/#primaryimage","url":"https:\/\/code.efi.ohmportal.de\/blog\/wp-content\/uploads\/2022\/12\/aoC.jpg","contentUrl":"https:\/\/code.efi.ohmportal.de\/blog\/wp-content\/uploads\/2022\/12\/aoC.jpg","width":1000,"height":417,"caption":"Advent of Code @ EFI"},{"@type":"WebSite","@id":"https:\/\/code.efi.ohmportal.de\/blog\/#website","url":"https:\/\/code.efi.ohmportal.de\/blog\/","name":"Code Comments","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/code.efi.ohmportal.de\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Person","@id":"https:\/\/code.efi.ohmportal.de\/blog\/#\/schema\/person\/cd22585e9c447d5140fab876575fc394","name":"Oliver Hofmann","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/code.efi.ohmportal.de\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b0d136459d060e391d2d3cc30a86b2bd4bb87d7358a51931de0a12ddd4f2f2bb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b0d136459d060e391d2d3cc30a86b2bd4bb87d7358a51931de0a12ddd4f2f2bb?s=96&d=mm&r=g","caption":"Oliver Hofmann"},"sameAs":["http:\/\/www.welearn.de\/fakultaet-iw\/personen\/details\/person\/prof-dr-oliver-hofmann\/"],"url":"https:\/\/code.efi.ohmportal.de\/blog\/author\/hofmanno\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/code.efi.ohmportal.de\/blog\/wp-content\/uploads\/2022\/12\/aoC.jpg","jetpack_shortlink":"https:\/\/wp.me\/p8QwJV-rE","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/code.efi.ohmportal.de\/blog\/wp-json\/wp\/v2\/posts\/1714","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code.efi.ohmportal.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code.efi.ohmportal.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code.efi.ohmportal.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/code.efi.ohmportal.de\/blog\/wp-json\/wp\/v2\/comments?post=1714"}],"version-history":[{"count":3,"href":"https:\/\/code.efi.ohmportal.de\/blog\/wp-json\/wp\/v2\/posts\/1714\/revisions"}],"predecessor-version":[{"id":1719,"href":"https:\/\/code.efi.ohmportal.de\/blog\/wp-json\/wp\/v2\/posts\/1714\/revisions\/1719"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code.efi.ohmportal.de\/blog\/wp-json\/wp\/v2\/media\/1666"}],"wp:attachment":[{"href":"https:\/\/code.efi.ohmportal.de\/blog\/wp-json\/wp\/v2\/media?parent=1714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code.efi.ohmportal.de\/blog\/wp-json\/wp\/v2\/categories?post=1714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code.efi.ohmportal.de\/blog\/wp-json\/wp\/v2\/tags?post=1714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}