There has been times that Rails will not work because of errors, and I get frustrated that I feel like I am pulling my hair out. Sometimes these things happen because we pulled the code from GitHub or there is a corrupted file or something else. …

In the previous two articles, I discussed object oriented programming in Java and some concepts that are good to know. In the second article, the concepts I discussed are how to make a class and constructors and print out words. …

Java is another popular language used by about three billion people. It is used in mobile and desktop applications, games, and more. In a previous article, I discussed the object oriented programming concepts of Java. Here, I will discuss other important concepts.

The first basic concept to know is how…

One of the first things I learned when it comes to a programming language is functions. In Java, a function, sometimes called a method, is written as

public class Main {
public static void example() {
// insert code here

All functions must be written inside of a…

Another week has passed so let’s discuss a new algorithm. For this problem, we want to find a missing number inside of an array. The number we want is the smallest possible positive integer that is missing inside of the array. For example, let’s look at an array

var A…

What is a binary number? For starters, it is a base-2 number system that uses only two numbers: mainly 0 and 1. The modern system was studied in the 16th and 17th centuries in Europe, but it first appeared much earlier starting in Egypt, China, and India.

Binary numbers have…

This week, we will focus on finding a difference within an array. The question is given an array with a number k, find all the pairs such that the difference between them is k. More specifically, given the values

arr = [0, -1, -2, 2, 1], k = 1


Malls became a popular place to go to in the US during the 20th century. The place gets busy during the day, weekends, and holidays. …

It is another week so it is time to show how to solve another algorithm. From Leet Code, given an array nums, find the length of the continuous unsorted subarray. For example, given the array

var nums = [2,6,4,8,10,9,15]

the output will be

output: 5

in which the unsorted numbers…

Last week, I discussed the problem of rotating an array. To refresh the problem, the question is given an array

var arr = [1, 2, 3, 4, 5]

and number of rotations

var k = 2

the final rotation should be

[4, 5, 1, 2, 3]. 

To do this, we…

Darrick Pang

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