# CoDEVIANT #27 — Goldilocks, Kit-Kat Bars, & the Three Integers

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

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. …

# CoDEVIANT #26 — Fibonacci Fun

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.

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

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

# CoDEVIANT #25 — Linked List Surgery

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:

Our mission is to write a function that:

• Takes an integer k
• Removes the kth node from the end of the Linked List

SPECIAL DIRECTIONS:

# CoDEVIANT #24 — Apples Falling from the Binary Tree

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…

# CoDEVIANT #23 — Tree Hee Hee

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

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.

So I come to…

# CoDEVIANT #22 — Linked Lists and Pyramid Schemes (I.P.)(10/12/20)

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…

# CoDEVIANT #21 (10/11/20) — Spiral Motion

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.

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…

# CoDEVIANT #20 (10/7/20)-Strings and Things (Soup is good food)

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

So here’s how I solved it:

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

# CoDEVIANT #19 — If there’s a problem yo I’ll solve itCheck out the hook while my DJ revolves it!

…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…

# CoDEVIANT #18 (10/5/20) — Sprinkles on Top!

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…