Photo by William Krause on Unsplash

Some Flatiron School colleagues and myself decided to work on a group project in order to continue to flex our programming muscles! We decided to create a Instagram web application clone and add some features of d3.js, devise, Oauth and more in order to have more experience using these tools.

As this is my first big group project, I was looking forward to bouncing off ideas with focus driven people and I was glad that was the case. The first day we planned out the backend of our application by using a whiteboard to write down the model associations, our…


Photo by Mario Mesaglio on Unsplash

Problem 1: Recursive Digit Sum

We are given the task to solve for the super digit, which is the digit that is sum of a longer digit. Our known variables are n and k, n represents the large number that is a string and k represents the total amount of times n is concatenated. In the example below n is ‘9875’ and i is 4. The variable p is the result of concatenating n, so the amount is ‘9875987598759875’. However since this amount is in a string, we must separate the individual element from the overall string and then change…


Photo by Lukas Blazek on Unsplash

I’ve been learning much about D3 and its usefulness this past week. In the course so far I was able to do week 1 with no problem since it was just a JavaScript refresher course. For the week 2 curriculum, I learned about writing the code to create bar charts and label the x and y axis with information being passed down from a csv file with multiple columns of information. The assignment from this course is to gradually add more lines of code to the index.html in order to come up with a stunning and visually appealing data charts…


Photo by Campaign Creators on Unsplash

I came across D3 when I was applying to a position at a media company and was asked in a code challenge to submit a bar chart with data that is within a csv file. Unfortunately I was unable to complete the challenge but it opened my eyes to what I can learn. In my previous projects I created mostly task and list tracking web apps because I’m a stickler when it comes to being organized. So writing code to produce charts was definitely out of my wheel-house. …


Photo by Ibrahim Rifath on Unsplash

The Coin Change problem is one of the more popular dynamic programming algorithm problems I have come across. We will go in depth to solve and better understand how to solve this problem using dynamic programming.

First, what is dynamic programming? Dynamic programming is an algorithmic technique for solving an optimization problem by breaking it down into simpler subproblems and utilizing the fact that the optimal solution to the overall problem depends upon the optimal solution to its subproblems. …


Photo by Richard Burlton on Unsplash

This week I will be going over a problem from Hackerrank. The problem is titled Birthday Cake Candles.

1)Birthday Cake Candles

The problem reads:

You are in charge of the cake for a child’s birthday. You have decided the cake will have one candle for each year of their total age. They will only be able to blow out the tallest of the candles. Count how many candles are tallest. Count how many candles are tallest.

Given function:

function birthdayCakeCandles(candles) {

}

Candles represents the sample case array [3, 2 , 1, 3].

In this case, just by looking at…


Although I enjoy figuring out questions on LeetCode and HackerRank, there are times were I get stumped. This medium level question on HackerRank titled “Forming a Magic Square” is very tricky. Working alongside my other Flatiron colleagues, we ended up passing the two sample test cases. However, when submitting the code, we failed 18/23 test cases! How come? Well it’s better that I start off with the code that I worked on but first the word problem.

Problem: https://www.hackerrank.com/challenges/magic-square-forming/problem

We are given a 3x3 matrix where the numbers within the matrix must be the integers of 1–9. These integers may…


Photo by Markus Spiske on Unsplash

The problem reads:

Given a list of the scores of different students, items, where items[i] = [IDi, scorei] represents one score from a student with IDi, calculate each student's top five average.

Return the answer as an array of pairs result, where result[j] = [IDj, topFiveAveragej] represents the student with IDj and their top five average. Sort result by IDj in increasing order.

A student’s top five average is calculated by taking the sum of their top five scores and dividing it by 5 using integer division.

Input: items = [[1,91],[1,92],[2,93],[2,97],[1,60],[2,77],[1,65],[1,87],[1,100],[2,100],[2,76]]

Starting point:

const highFive = (items) => {

};


The problem states the following:

Given an integer x, return true if x is palindrome integer.

An integer is a palindrome when it reads the same backward as forward. For example, 121 is palindrome while 123 is not.

Example 1:

Input: x = 121
Output: true

Solution:

Step #1: I first converted the isPalindrome method to be written in ES6 notation.

const isPalindrome = (x) => {
};

Step #2: We build out our if statement by typing the following:

if (x<0 || x%10 === 0 && x !== 0) return false;

This reads if x is less than 0…


The algorithm problem is as follows:

Given the array nums, for each nums[i] find out how many numbers in the array are smaller than it. That is, for each nums[i] you have to count the number of valid j's such that j != i and nums[j] < nums[i].

Return the answer in an array.

Example 1:

const smallerNumbersThanCurrent = (nums) => {

};

nums = [8,1,2,2,3]

Step #1: Starting off, we know that we will be using the forEach method within our answer since when reading the problem, we get a clue from “for each nums[i] “. …

Perezchristian

Flatiron School Graduate with finance, budget, and tax experience.

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