Picking garbages in groups

In today’s post, I will describe my solution to Advent of Code year 2017, day 9’s challenge. Let’s read the challenge description before the explanation. Part 1 Part 1 of the problem expects us to report the total number of groups, as collected from the stream of characters. The rules are simple: { marks the beginning of the group unless that’s found in the garbage } marks the end of the group unless that’s found in the garbage First group encounter will have the level of 1, nested groups will have their levels as their depth, as an example, the innermost group of {{{}}} will have level of 3. Groups are separated by commas. Now that is the easy part, let’s get to the garbage. ...

November 2, 2021 · 8 min · 1517 words · Mafinar K.

Stacked Reactions

tl;dr I solved Advent of Code Year 2018, Day 5 and here is the code. When I first encountered LIFO (i.e. Stack) data structures back in my Algorithmics course, I found the implementation to be easy compared to, say linked lists, however, to identify its use in a real life problem (for instance, parenthesis matching) was something I had struggled with. I mean, I would probably be able to solve one with stitching expressions and statements together, but to immediately realize that the problem is addressable with a stack never came to me easily. I eventually overcame that (Or so I think), and today’s post, and the advent of code puzzle involved, involves a LIFO. ...

August 2, 2021 · 7 min · 1313 words · mafinar

Many Ways to Reach a Floor

This is day 1 of my #100DaysOfFSharp and in this post I will talk about what I learned today. I tried solving Advent of Code 2015’s Day 1 - an easy problem that packed a lot of F# education for me. The problem is stated in the link but the tl;dr of it is climbing up and down based on a specific instruction - ( means going up while ) means down. And the input is a lot parenthesis- reminiscent of Lisp jokes. The title of the problem: Not Quite Lisp ...

July 14, 2021 · 8 min · 1542 words · mafinar

Day 3 - Mix

OMG It’s over six months and I’m at day 3! Let’s mix in some tooling today

January 16, 2017 · 7 min · 1437 words · Mafinar Khan

Day 2 - Diving in...

Since last night I’ve been playing with some of the data structures of Elixir, mostly lists, tuples and maps. While I’m not new to these data structures, the way Elixir’s API is laid out is a little different and took awhile to get used to

July 5, 2016 · 10 min · 2113 words · Mafinar Khan

Day 1 - Tabula Rasa

I did enough exploration the past few days and it’s time I clean slate and proceed as someone learning Elixir. Not a Python programmer trying to translate Python idioms into Elixir or a Clojure programmer’s view of the language, but starting with a clean slate and learning from zero.

July 2, 2016 · 14 min · 2911 words · Mafinar Khan

Day 0 - Unboxing and Exploration

Let’s install this thing and do some explorations. This is a totally random, unplanned, whatever-may-come-into-your-mind post where I just query syntactic constructs and map it with Elixir’s. Going to be full of misinformations and bloopers, I assume

June 27, 2016 · 7 min · 1446 words · Mafinar Khan