ConnorRigby
Did I cheat at Advent of Code?
SPOILERS AHEAD DON’T CONTINUE IF YOU PLAN ON DOING THE CHALLENGE
I always start Advent of Code, then forget about half way through the month. I really hope to finish this year, but i think i cheated on part two of December 2.
The challenge is to compare strings and find the one that has but one letter change between strings.
here is what i came up with.
Basically it boils down to:
case String.myers_difference(string, check) do
[eq: pt1, del: <<_>>, ins: <<_>>, eq: pt2] -> pt1 <> pt2 # the answer.
_ -> false # move on to the next one.
end
I haven’t looked at anyone else’s implementation of this one yet, but i know this isn’t the intended method of solving this. It got me thinking though: does anyone else try to solve these questions in “illegal” ways?
Most Liked
sasajuric
I wouldn’t say that there is such thing as cheating in AoC. For me, these puzzles are about the goals you set for yourself. Many people just like to solve them for fun, and reach for whichever improvisation can help them. For example, one friend solved a puzzle last year on a piece of paper, and a few others by using grep from command line ![]()
When I did AoC last year, my main goal was to practice streams. I also tried to reach the solutions I’m happy with. In some cases, even after solving the challenge, I’d spend a few more sessions (sometimes even spread over a few days) to improve the solution.
So in my view, you set your own rules, and decide when you’re happy with your solution.
yawaramin
You mean did we take full advantage of the language syntax and semantics? Yup!
I did something similar to you, see my post for more details: Advent Of Code 2018 - #19
dbern
I was comparing with a JavaScript developer’s solution, and ya… Elixir is really nice
I don’t feel like I cheated, but I definitely felt like I had it easier.
Popular in Discussions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









