Did you know that integers can swallow children whole? They also roam national parkgrounds and swipe peoples’ pic-nic baskets.

Just pulling the ol’ 1,2,3,4,5,6,7,8,9….y’know the rest

Well today we’re going to solve a neat little problem. I have recently discovered my developer super power. As an extremely visual person who suffers from not always having a largess of working memory, I find it helpful to draw pictures. Seriously, little hieroglyphics representing images of what I want to achieve in steps really makes a huge difference for me. …

Our job is to find the nth Fibonacci number via a function we will write that takes an integer n. We will get the nth number by adding

So before I started this, I actually didn’t know what a Fibonacci Number was, honest to God.

I have a doctorate in music, I can help the patient onboard!

But to break it down really quickly, here’s what it is:

  • You always start with 0, followed by 1.
  • Every subsequent number in the list is the sum of the last two numbers
  • Example: [0, 1, 1, 2, 3, 5, 8, 14, …..]

So today, we’re going to put a linked list under a scalpel. Our job is to make sure we don’t fuck up the entire list while trying to get one little node out of there the correct way.

How I think I’ll approach this:

Althought it may end up more like this:

What’s a matter, Red? You scared??

Our mission is to write a function that:

  • Takes the head of a Singly Linked list
  • Takes an integer k
  • Removes the kth node from the end of the Linked List


  • If the head of the linked list turns…

You know what they say about apples: that they don’t fall far from the tree. Today’s problem is about finding the depth of a tree. What does this mean? Well, it means we are going to count the number of links it takes to get to a given node from the root. Then we add all of those numbers together to calculate the “depth”.

Consider this crudely drawn tree. Each red arc that ends on a node signifies a measurement of depth. Focusing on just the left side of the tree starting from the root, we go down to the…

So remember about a month ago when I said “I’m going to do my best to make writing these a daily thing!”….?

This….THIS is the energy.

Well, life got in the way. I had a slew of interviews, none of which I got the job for.

And I’ve been working on some side projects and recovering from the run-up to election week…then election week itself.

Anyways, I’ve been getting back to my data-structure studies and I have learned a great deal more about graphs, stacks, queues, hash-tables, and trees.

Not those kinds of trees.

So I come to…

Hey people, sorry for the delay. I try to make these articles a daily thing (or as close to it as my pea-brain will allow). However, as is wont to occur, I occasionally run into new concepts that take a while for me to wrap my head around. My personal belief is that if you can teach something to someone you’re that much closer to really understanding what the hell you’re talking about.

To that end, I found myself learning more about data-structures these past few days. I spent alot of time on linked-lists. I always knew that the difference…

So I’ve got a neat doozy of a problem to write about here.

We are to write a problem that takes a two-dimensional array and returns an array of the values when the values are read in a spiral motion.

You spin me right round, baby, right round like algorithm, baby right right round… XD

So…I got a confession to make. I couldn’t figure out how to solve it by myself. After a number of failed attempts, I swallowed my pride and consulted the experts. But I learned a lot and I’m excited to share some knowledge with you!

Before I share the answer, I want to give an example of the kind of…

Problem# 1: Now this one is a pretty classic and simple one, but I’m looking at it today because I am getting better at utilizing pointers and while-loops instead of using a boatload of for-loops.

So we are writing a function that takes a non-empty string and returns a boolean representing whether that string is a palindrome. In this problem, single character strings are considered palindromes.

Palindrome: a word or phrase that reads the same backward as forward

I don’t know who wouldn’t know that, but…just in case.

So here’s how I solved it:

function isPalindrome(string) {
if(string.length === 1)…

If other devs are rappers, I’m Vanilla Ice.

…but regardless, I can at least spit some bars and get a single out there. I’m trying to be good. I’m trying to be better. I put my time in, I gets down.

Today’s problem is kinda cool because I learned a new $5 Word: Monotonic.

In the context of an array, it means that the elements are successively either non-increasing or non-decreasing. For the layman (like me): basically, it’s all going up or it’s all going down.

Problem: We want to write a function that takes an array of integers and…

Once upon a time, I had a really wild dream. I dreamt that I was in the last ice-cream shop in the galaxy; it was right on the edge of the cosmos. In most diner-style ice-creameries, you can peruse a juke-box containing myriad more choices of songs than there are flavors behind the counter. In my dream, however, it was quite the opposite. The taste combinations were everything you ever wanted, even if — in some cases — you had never conceived of them before. The aliens working the joint were friendly and passionate about frozen dairy dessert products, but…

Adrian Rosales

is a web developer, opera singer, actor, and lover of cats. (adrian-rosales.tech)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store