Efficient and understandable solution to both tasks in Python. If you have some problems with the tasks it can maybe help you. Using intersection and ASCII seems pretty neat imo.
I did it with full brute force too, but i wanna find different solution without it. Do you have any ideas? I searched whole internet in hopes to find some build in functions which find the even letter in string. I thought i would do that if i sort the string and then remove the unnecessary stuff but it would be more complicated and probably even slower than the brute force
Inlined code is intended for short snippets of code only. Your code "block" right now is unreadable on old.reddit and many mobile clients; it's all on one line and gets cut off at the edge of the screen because it is not horizontally scrollable.
JAVASCRIPT PART 2. Hello, It's me again. I'm learning JS, still a beginner. Started my journey back in september this year. You'll see a lot of if statements and console.logs because that's how I manage to keep my line of thought and to check if my code is working. I still don't know how to condensate everything in shorter cleaner code. I'm doing what I can, I think tis activities are pretty fun =)
JAVASCRIPT. Hello, It's me again. I'm learning JS, still a beginner. Started my journey back in september this year. You'll see a lot of if statements and console.logs because that's how I manage to keep my line of thought and to check if my code is working. I still don't know how to condensate everything in shorter cleaner code. I'm doing what I can, I think tis activities are pretty fun =)
thanks for that video, i learned a few tricks there. i can't quite figure out how your code understands to look for input in the text files, however, especially in part 2. wouldn't input() cause a prompt to appear for you to manually enter in input?
Very neat even if I don't fully understand how the bit stuff works. Are you basically using the strings as bit masks? Not sure how the u64::BITS - common.leading_zeros() part works either.
J from
dc
I have both of the parts as 12 lines in Python 😎
Python
OMG, openAI just provided me:
Efficient and understandable solution to both tasks in Python. If you have some problems with the tasks it can maybe help you. Using intersection and ASCII seems pretty neat imo.
My own language
Javascript
Java
Bit late to the party, but Python. Full brute force.
I did it with full brute force too, but i wanna find different solution without it. Do you have any ideas? I searched whole internet in hopes to find some build in functions which find the even letter in string. I thought i would do that if i sort the string and then remove the unnecessary stuff but it would be more complicated and probably even slower than the brute force
My solutions in Python:
JavaScript Day 3
TensorFlow
Solution in JavaScript:
Rust
TypeScript
In single-statement t-sql
Python - Dont try to understand... (Part 1 and 2 in 4 lines)
Inlined code is intended for short snippets of code only. Your code "block" right now is unreadable on old.reddit and many mobile clients; it's all on one line and gets cut off at the edge of the screen because it is not horizontally scrollable.
Kotlin
JavaScript Part 1 & 2
Here's
JQ
JAVASCRIPT PART 2. Hello, It's me again. I'm learning JS, still a beginner. Started my journey back in september this year. You'll see a lot of if statements and console.logs because that's how I manage to keep my line of thought and to check if my code is working. I still don't know how to condensate everything in shorter cleaner code. I'm doing what I can, I think tis activities are pretty fun =)
protip
Err... next time, please don't make 2 posts; combine them into one post.
Keep doing what you started, looks cool! :) My experience is that first we learn consistency and then we can go for efficiency and compactness.
JAVASCRIPT. Hello, It's me again. I'm learning JS, still a beginner. Started my journey back in september this year. You'll see a lot of if statements and console.logs because that's how I manage to keep my line of thought and to check if my code is working. I still don't know how to condensate everything in shorter cleaner code. I'm doing what I can, I think tis activities are pretty fun =)
Both of your part 1 and 2 code blocks are too long for the megathreads. Please read our article on
Python 3.10
Elixir
Scala
C# solution using .NET Interactive and Jupyter Notebook
I had the same reaction! Always saw Chunk() but never used it! Feels good to use niche tools
Dart
Rust
AppleSoft BASIC on Apple //c
Emacs Lisp:
Go solution based on bitsets with O(1) space requirements.
I'm no go expert, but even looking it up in the
PHP to convert from ASCII character decimal value to the score you want:
You can avoid the ASCII range check by using ctype_upper
Python.
import string
A hint for not having to type out the whole alphabet:
C++- Day 3
Java 17 solution:
F# solution
Python (Beginner/Beginner friendly):
C (plan9)
Python 3
Python
Please edit your post to use the
Python 3
thanks for that video, i learned a few tricks there. i can't quite figure out how your code understands to look for input in the text files, however, especially in part 2. wouldn't input() cause a prompt to appear for you to manually enter in input?
C# with one line linq
C# solution using LINQ,
Thank you for the Chunk function!
Kotlin
Nice, learned some Kotlin things here, thanks!
Scratch:
I tried it in Snap!
Beginners Python Journey through AoC: (Day 3)
Go/GoLang
Rust
Rust
Rust
COBOL -
Rust. I'm sure these could be much better - let me know if you have any suggestions!
Day 03 2022 -
Rust -- my solution makes use of HashMaps and HashSets:
Python 3: Parts 1 & 2:
Python
Yet another Python based snakey one. Also a bit late to the party due to other commitments.
x64 assembly
Excel:
Python 3
Terraform / HCL
Python 3 (covers both part one and two) :
Julia. Learning Sets and map vs comprehension, and now realising some splatting and indexof would have been nice.
Solution for both parts in Python:
[Scala]
Apps Scripts day 3 (Part 1&2)
I'm doing different language each day, all solutions
Max MSP
Python
Rust using nom to parse
Clojure implementation from a beginner in clojure:
Just so you know, (map seq) does the same thing as (map #(map char %)) when you have a sequence of strings
Nim
Elixir
Go / Golang
Solution in Rye (ryelang.blogspot.com)
If I specialize fold to add-up, because there is a lot of adding up in fold/reduces in general:
Desmos -
Java
Javascript
APL
Kotlin
JAVA day 3 using two array maps to check for duplicate. Could have used a hash map if you want to.
TypeScript/Deno
Please edit your post to use the
Node + TypeScript
Elixir
FYI: your link is borked on old.reddit and some mobile Reddit apps.
Python soution on
Python
Chapel
Tailspin
Python 3
Please edit your post to use the
Mumps/M (tested in GTM, had too many issues with OpenMumps)
Elixir one-liner
[удалено]
PureScript
rust
Rust Part 1 & 2
Python: Part 1:
FiM++
FiM++ Part 2
Part 1 Solution in Ryelang (
Python 3
C#
I hope you enjoy my solution.
Groovy Part 1 and 2:
Ruby solution
Please edit your post to use the
C#
C Language for the Game Boy using GBDK 2020
DOT MATRIX WITH STEREO SOUND <3
Python 3.11
GW-BASIC
Uncompressed and commented BASIC code (no line numbers so they need to be added or run in QBASIC which doesn't require them):
Common Lisp
C# LinqPad
Hello, I am a noob. I like your solution! I was just wondering, how is it that you get the source text file into Linqpad? Thanks heaps for any tips.
Rust, short and sweet, no_std, no allocations, all bit fiddling:
Very neat even if I don't fully understand how the bit stuff works. Are you basically using the strings as bit masks? Not sure how the u64::BITS - common.leading_zeros() part works either.
Python 3
Ansible
[удалено]
Post removed.
TypeScript
Python, both parts golfed to 140 bytes:
Python3
Solved in C++
Python Part 1 and 2
Julia
Python
Please edit your post to use the
Python solution
Javascript Interactive Solution
Please edit your post to
Please forgive me for this, but I decided to try some code golf.
[удалено]
Forget about it. My notepad is just crazy!!!!
Post removed because
Your input is wrong, there should only be one possibility.
C
[удалено]
My julia solution.
Please edit your post to use the
Clojure
Rust using some of the bytes logic that I saw from other people's code from days 1 and 2:
Lazy Golang code and a complete 7+ year repo :)
Python 3.10 (uses new pattern matching syntax)
Please edit your post to use the
Clojure (oof, reddit markdown format does not like clojure):
Rust
thalovry
Aha, found a way for (1)
Python 3
[удалено]