Please turn JavaScript on
Another Casual Coder icon

Another Casual Coder

Receive updates from Another Casual Coder for free, starting right now.

We can deliver them by email, via your phone or you can read them from a personalised news page on follow.it.

This way you won't miss any new article from Another Casual Coder. Unsubscribe at any time.

Site title: Another Casual Coder

Is this your feed? Claim it!

Publisher:  Unclaimed!
Message frequency:  0.11 / day

Message History

Although it is an easy problem and likely there is a clever way to solve it using just mathematical tricks, I decided to do a full implementation of Depth-First Search (DFS). Notice that the "visited" requires you to also use the cardinality of the number of steps taken. Code is down below, cheers, ACC.


Read full story

Post-Order traversals were, to me, the most unintuitive types of traversals because you are performing the induction before the base case, but once you grasp the idea it is very powerful, this problem exemplifies it clearly. Code is down below, cheers, ACC.


Read full story

We don't want to do an N^2 solution here since N=10^5. Since the numbers are all positive, cache the max number from nums.Length-1..j, and use this cached value for a linear computation of the solution. Code is down below, cheers, ACC.

Maximum Valid Pa...


Read full story

In reality this question is just looking for the following: find the connected components to vertex 1, and select the minimum edge. That's it. The problem statement guarantees that there will be at least one connection between 1 and N. That way, just traverse the graph looking for the smallest edge, starting from 1. Code is down below, cheers, ACC.


Read full story