# Advent of Code 2025

**URL:** <https://forums.swift.org/t/advent-of-code-2025/83424>\
**Category:** Community Showcase\
**Tags:** adventofcode\
**Created:** [November 26, 2025, 7:22pm UTC](https://forums.swift.org/t/advent-of-code-2025/83424 "2025-11-26T19:22:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![maartene](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/maartene/32/42076_2.png) [@maartene](https://forums.swift.org/u/maartene)\
**Post date:** [November 26, 2025, 7:22pm UTC](https://forums.swift.org/t/advent-of-code-2025/83424/1 "2025-11-26T19:22:28Z")

</div>

Hi Swift Community!

It's the most Wonderful Time Of The Year. Time to ~~spend with Family and Friends~~ spend on _ **Swift coding challenge fun** _!

Every December, [Eric Wastl](http://was.tl) publishes [Advent of Code](https://adventofcode.com/), a fun set of coding exercises. One challenge is posted each day from December 1st to December ~~25~~ 12th \[1\]. The challenges start out easy and increase in difficulty. Here’s the [first exercise from last year](https://adventofcode.com/2024/day/1) for example.

You can use whatever programming language and techniques you like to complete the exercises, but of course, **we use Swift!** Participating is a great way to sharpen your Swift skills and have a little fun with the community.

For those interested, we have [a starter template to help you get going](https://github.com/apple/swift-aoc-starter-example), though its not needed per se.

To participate with Swift:

1. Create an Xcode project (Command Line Tool is fine), Swift Package or [clone the starter project](https://github.com/apple/swift-aoc-starter-example)  
a. if your repo is public, make sure to exclude the input data from version control
2. [Create an account](https://adventofcode.com/2024/auth/login) at Advent of Code (required to use the leaderboard)
3. [Join the Swift community leaderboard](https://adventofcode.com/2024/leaderboard/private) to participate with others. Use ID `3315857-05237f97`. Up to 200 players can join the leaderboard.
4. Every day (or as often as you prefer), attempt the challenge using Swift!

The leaderboard will automatically update to show who has completed the challenge and provide a score based on how long it took you. You can always ignore the score of course - it’s just for fun!

We'd encourage you to include a link to your GitHub account where you can post your solution. It’s really neat to see how everyone attempts each day’s challenge: we learn new things about how others use the Swift language, and you can pick up some great tips and techniques from studying others' work.

Look forward to seeing you online!

* * *

1. This year the number of challenges [changed](https://adventofcode.com/2025/about#faq_num_days) from 25 to 12. Meaning that the event will run until mid-december instead of Christmas Day.

---

<div class="post-metadata">

**Author:** ![gereons](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/gereons/32/38393_2.png) [@gereons](https://forums.swift.org/u/gereons)\
**Post date:** [November 27, 2025, 7:36am UTC](https://forums.swift.org/t/advent-of-code-2025/83424/2 "2025-11-27T07:36:40Z")

</div>

Count me in. My solutions will be at [gereon/AoC2025: Advent of Code 2025 - Codeberg.org](https://codeberg.org/gereon/AoC2025)

---

<div class="post-metadata">

**Author:** ![Andropov](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/andropov/32/35955_2.png) [@Andropov](https://forums.swift.org/u/Andropov)\
**Post date:** [November 27, 2025, 9:15pm UTC](https://forums.swift.org/t/advent-of-code-2025/83424/3 "2025-11-27T21:15:25Z")

</div>

Genuinely excited for this year's Advent of Code! I had a lot of fun last year 😄

May even get the chance to try out shiny new Swift features like `InlineArray`.

I'll share my results here: [GitHub - Androp0v/AdventOfCode2025](https://github.com/Androp0v/AdventOfCode2025)

---

<div class="post-metadata">

**Author:** ![gingofthesouth](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/gingofthesouth/32/43576_2.png) [@gingofthesouth](https://forums.swift.org/u/gingofthesouth)\
**Post date:** [November 27, 2025, 10:49pm UTC](https://forums.swift.org/t/advent-of-code-2025/83424/4 "2025-11-27T22:49:29Z")

</div>

Long time reader, first time player.

> **[GitHub - gingofthesouth/Advent-of-Code-2025: My repo for AoC 2025](https://github.com/gingofthesouth/Advent-of-Code-2025)**
>
> My repo for AoC 2025

Looking forward to taking some time out of my day to have a little fun.

---

<div class="post-metadata">

**Author:** ![maartene](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/maartene/32/42076_2.png) [@maartene](https://forums.swift.org/u/maartene)\
**Post date:** [November 28, 2025, 9:52am UTC](https://forums.swift.org/t/advent-of-code-2025/83424/5 "2025-11-28T09:52:58Z")

</div>

Also, my stuff can be found here: [GitHub - maartene/AoC2025: AoC2025 using Swift](https://github.com/maartene/AoC2025)

---

<div class="post-metadata">

**Author:** ![tracymiranda](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tracymiranda/32/40951_2.png) [@tracymiranda](https://forums.swift.org/u/tracymiranda)\
**Post date:** [November 28, 2025, 2:40pm UTC](https://forums.swift.org/t/advent-of-code-2025/83424/6 "2025-11-28T14:40:51Z")

</div>

> [@maartene](#):
>
> [clone the starter project](https://github.com/apple/swift-aoc-starter-example)

Thanks for sharing - this looks great and glad you link to VS Code Swift too in the starter project - though looks like it is the deprecated extension, rather than the newer one. Would it be possible to update to `https://marketplace.visualstudio.com/items?itemName=swiftlang.swift-vscode`

---

<div class="post-metadata">

**Author:** ![maartene](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/maartene/32/42076_2.png) [@maartene](https://forums.swift.org/u/maartene)\
**Post date:** [November 28, 2025, 2:50pm UTC](https://forums.swift.org/t/advent-of-code-2025/83424/7 "2025-11-28T14:50:50Z")

</div>

Nice catch! I created a PR for the repo to change the link.

---

<div class="post-metadata">

**Author:** ![iamhands0me](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/iamhands0me/32/43602_2.png) [@iamhands0me](https://forums.swift.org/u/iamhands0me)\
**Post date:** [December 1, 2025, 8:43am UTC](https://forums.swift.org/t/advent-of-code-2025/83424/8 "2025-12-01T08:43:52Z")

</div>

Checking my Functional style solution by using Swift Algorithms ☺

> <https://github.com/iamhands0me/Advent-of-Code/blob/main/Day%2001%20-%20Secret%20Entrance.swift>

---

<div class="post-metadata">

**Author:** ![maartene](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/maartene/32/42076_2.png) [@maartene](https://forums.swift.org/u/maartene)\
**Post date:** [December 1, 2025, 10:29am UTC](https://forums.swift.org/t/advent-of-code-2025/83424/9 "2025-12-01T10:29:06Z")

</div>

Cool solution! 😍

---

<div class="post-metadata">

**Author:** ![tommyming](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tommyming/32/36604_2.png) [@tommyming](https://forums.swift.org/u/tommyming)\
**Post date:** [December 2, 2025, 7:19am UTC](https://forums.swift.org/t/advent-of-code-2025/83424/10 "2025-12-02T07:19:28Z")

</div>

Finally the month for Advent of Code and Christmas!

Here’s my repo: [GitHub - tommyming/aoc-2025-swift: Doing Advent of Code 2025, using Swift](https://github.com/tommyming/aoc-2025-swift)  
Have a look if you are interested

---

<div class="post-metadata">

**Author:** ![rbruinier](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/rbruinier/32/19556_2.png) [@rbruinier](https://forums.swift.org/u/rbruinier)\
**Post date:** [December 2, 2025, 10:17am UTC](https://forums.swift.org/t/advent-of-code-2025/83424/11 "2025-12-02T10:17:15Z")

</div>

Also joining again 🙂 My 2025 solutions can be found here: [AdventOfCode/Sources/Solutions/2025/Days at main · rbruinier/AdventOfCode · GitHub](https://github.com/rbruinier/AdventOfCode/tree/main/Sources/Solutions/2025/Days).

---

<div class="post-metadata">

**Author:** ![DavidKo](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/davidko/32/44007_2.png) [@DavidKo](https://forums.swift.org/u/DavidKo)\
**Post date:** [December 3, 2025, 4:18am UTC](https://forums.swift.org/t/advent-of-code-2025/83424/12 "2025-12-03T04:18:53Z")

</div>

高手! 失敬失敬

Looking at your solution then look at your Leetcode.

---

<div class="post-metadata">

**Author:** ![BoseSj](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/bosesj/32/35018_2.png) [@BoseSj](https://forums.swift.org/u/BoseSj)\
**Post date:** [December 3, 2025, 6:06am UTC](https://forums.swift.org/t/advent-of-code-2025/83424/13 "2025-12-03T06:06:53Z")

</div>

Here's my repo:

> **[GitHub - BoseSj/SwiftAOC25: Progress and Activities for 2025 Advent of Code -...](https://github.com/BoseSj/SwiftAOC25)**
>
> Progress and Activities for 2025 Advent of Code - Using Swift

---

<div class="post-metadata">

**Author:** ![BoseSj](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/bosesj/32/35018_2.png) [@BoseSj](https://forums.swift.org/u/BoseSj)\
**Post date:** [December 3, 2025, 6:09am UTC](https://forums.swift.org/t/advent-of-code-2025/83424/14 "2025-12-03T06:09:05Z")

</div>

Implemented a circular linkedList. Seemed easiest to me for that time.

---

<div class="post-metadata">

**Author:** ![BoseSj](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/bosesj/32/35018_2.png) [@BoseSj](https://forums.swift.org/u/BoseSj)\
**Post date:** [December 3, 2025, 6:31am UTC](https://forums.swift.org/t/advent-of-code-2025/83424/15 "2025-12-03T06:31:50Z")

</div>

Well, I am proceeding bit slow, having the problem understanding the Day 2’s example test case.

- `95-115` has one invalid ID, _`99`_ \<\< How it’s 99, should not it be _`11`_

- `998-1012` has one invalid ID, _`1010`_. \<\< & it should be _`99`_

- `1188511880-1188511890` has one invalid ID, _`1188511885`_. \<\< this _`1188`_

- `1698522-1698528` contains no invalid IDs. \<\< and this _`1698`_

- `446443-446449` has one invalid ID, _`446446`_. \<\< and this _`44644`_

- `38593856-38593862` has one invalid ID, _`38593859`_. \<\< and this should be `3859`

Am I missing something ?? :’)

---

<div class="post-metadata">

**Author:** ![gereons](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/gereons/32/38393_2.png) [@gereons](https://forums.swift.org/u/gereons)\
**Post date:** [December 3, 2025, 7:05am UTC](https://forums.swift.org/t/advent-of-code-2025/83424/16 "2025-12-03T07:05:20Z")

</div>

> [@BoseSj](#):
>
> - `95-115` has one invalid ID, _`99`_ \<\< How it’s 99, should not it be _`11`_
> - `998-1012` has one invalid ID, _`1010`_. \<\< & it should be _`99`_

> [@AoC](#):
>
> > Your job is to find all of the invalid IDs that appear in the given ranges.

11 is not in the 95…115 range

99 is not in the 998…1012 range

---

<div class="post-metadata">

**Author:** ![BoseSj](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/bosesj/32/35018_2.png) [@BoseSj](https://forums.swift.org/u/BoseSj)\
**Post date:** [December 3, 2025, 8:45am UTC](https://forums.swift.org/t/advent-of-code-2025/83424/17 "2025-12-03T08:45:09Z")

</div>

Got it. Thought they literally the IDs, we are talking about here. Missed the part where I need to go through the range 🙂

---

<div class="post-metadata">

**Author:** ![tevelee](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tevelee/32/9775_2.png) [@tevelee](https://forums.swift.org/u/tevelee)\
**Post date:** [December 3, 2025, 11:06am UTC](https://forums.swift.org/t/advent-of-code-2025/83424/18 "2025-12-03T11:06:32Z")

</div>

mine is [GitHub - tevelee/AdventOfCode](https://github.com/tevelee/AdventOfCode)

---

<div class="post-metadata">

**Author:** ![carlynorama](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/carlynorama/32/27072_2.png) [@carlynorama](https://forums.swift.org/u/carlynorama)\
**Post date:** [December 3, 2025, 2:55pm UTC](https://forums.swift.org/t/advent-of-code-2025/83424/19 "2025-12-03T14:55:08Z")

</div>

Sadly I'm busy trouble shooting some problems with my VSCode setup so I'm not yet able to use that fancy scaffold I used last year! Ooops!

In the mean time a package per day will work. Sorry for the mess.

> **[GitHub - carlynorama/AdventOfCode2025\_Public](https://github.com/carlynorama/AdventOfCode2025_Public)**
>
> Contribute to carlynorama/AdventOfCode2025\_Public development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![carlynorama](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/carlynorama/32/27072_2.png) [@carlynorama](https://forums.swift.org/u/carlynorama)\
**Post date:** [December 3, 2025, 3:17pm UTC](https://forums.swift.org/t/advent-of-code-2025/83424/20 "2025-12-03T15:17:29Z")

</div>

> **Day 3 Spoilers**
>
> Never been so grateful for Slices and their shared indexing, which I've previously been irritated by. I take it all back. I'm guessing it's not fast but it does get it done!
> 
> ```swift
> var found = ""
> var tapeHead = valuesString.startIndex
> for i in stride(from: cellCount, to: 0, by: -1) {
> let currentSlice = Slice(base: valuesString, bounds: tapeHead..<valuesString.index(valuesString.endIndex, offsetBy: -i+1))
> let max = currentSlice.max()!
> let maxIndex = currentSlice.firstIndex(of: max)! 
> found.append(max)
> tapeHead = valuesString.index(after: maxIndex) //so fancy that this works. 
> }
> 
> ```

[Next page](https://forums.swift.org/t/advent-of-code-2025/83424.md?page=2)
