Sign in

Software Engineering Student at Flatiron NYC. Learning day by day 💻
Photo by Crissy Jarvis on Unsplash

What is the Math Library?

JavaScript has a built-in Math library that I found very helpful many times already (refer to a few of my algorithm review problems). Math is a built-in object, not a function. It has properties and methods of static mathematical constants and functions.

  1. Math.ceil(x)
    This method rounds a number (usually a decimal) upwards to its nearest integer and returns the result. If the number x is an integer then there will be nothing to round.
    Math.ceil(1.4) // -> 2
    Math.ceil(2) // -> 2
  2. Math.floor(x)
    This method is the opposite of Math.ceil(x). It rounds the decimal number downwards to the nearest integer and…

This problem is found on LeetCode. I’ve done a lot of reversing strings and numbers so I thought this problem should be easy. It wasn’t…I found out here that reading closely is important even if you think you know what you’re doing.

Problem 7: Reverse Integer

Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-2^31, 2^31 - 1], then return 0.

Assume the environment does not allow you to store 64-bit integers (signed or unsigned).


Input: x = 123
Output: 321

Input: x = -123

React and React Native have similarities and differences. They are popular JavaScript frameworks that were developed by the same company. They both HEAVILY use class and functional components.

What is ReactJS?

It’s a JavaScript frontend library used to build the user interface on web applications. It is an open-source Javascript library developed by Facebook. It makes web applications much faster and more dynamic.

What is React Native?

It’s a Javascript framework for iOS and Android development. This was also created by Facebook, about two years after ReactJS was created. It makes it easier and more cost-effective to create mobile applications. …

Photo by Amit Lahav on Unsplash

A new week and a new problem. I found this problem on LeetCode. I had fun with this problem mainly because it had something to do with sweets.

Problem 1431: Kids With the Greatest Number of Candies

Given the array candies and the integer extraCandies, where candies[i] represents the number of candies that the ith kid has.

For each kid check if there is away to distribute extraCandies among the kids such that he or she can have the greatest number of candies among them. Notice that multiple kids can have the greatest number of candies


Input: candies = [2, 3, 5, 1, 3], extraCandies = 3
Output: [true, true…

Photo by Christina @ on Unsplash

***Disclaimer: If you are just getting started with React Native and have not set up your first React Native project yet, read my blog on how to getting started***

React Native has built-in components for us to use when making our apps. They can be found in the React Native documentation here. Don’t feel limited to these built-in components, we also have access to component libraries that have been created by the community of developers that we can access here.

To use one of the built-in components, you must import it from the react-native library at the top with the…

Another week and yet another algorithm problem from the Colt Steele Udemy course. This week I was working on multiple pointers, a technique I can use to solve problems without having to doubly loop. Instead, I would create pointers that would correspond to an index or a position and then move that pointer in any direction I need based on a condition.

Multiple Pointers — countUniqueValues

Implement a function called countUniqueValues, which accepts a sorted array, and counts the unique values in the array. There can be negative numbers in the arry, but it will always be sorted


Inputs: [1, 1, 1, 2]

Photo by on Unsplash

What is React Native?

React Native is a mobile development framework written in JavaScript. It uses React.js which is a JavaScript library for building user interfaces. It also has its own special components that know how to communicate with the native device’s platform so you can build a user interface. Mobile devices don’t use HTML tags so React Native gives us those components that can render our user interface. It gives us access to the device’s API like the device’s camera, and more.

It gives us everything we need to create a real mobile app that we could have in the IOS and Andriod…

anagram image of “listen” and “silent” with arrows pointing to matching letters

This week I was working on another algorithm problem from my Colt Steele Udemy course. This is another frequency counter type problem but this time I’m working to see if two strings are anagrams of each other.

Frequency Counter — validAnagram

Given two strings, write a function to determine if the second string is an anagram of the first. An anagram is a word, phrase, or name formed by rearranging the letters of another, such as “cinema”, formed from “iceman.”


Inputs: string1=“ ” , string2=“ ”
Output: true

Inputs: string1=“aaz” , string2=“zza”
Output: false

Inputs: string1=“anagram” , string2=“nagaram”
Output: true

Inputs: string1=“awesome” , string2=“awesom”

Photo by Markus Spiske on Unsplash

This week I was worked on an algorithm problem I came across on one of my Udemy courses by Colt Steele. I worked on how to problem-solve common algorithm question types. In particular how to turn an algorithm that would’ve been O(n²) if solved naively to an O(n) notation by using javascript objects instead of having a loop inside of a loop.

27. Frequency Counter Pattern

Write a function called same, which accepts two arrays. The function should return true if every value in the array has its corresponding values squared in the second array. The frequency of values must be the same.


Photo by Kelly Sikkema on Unsplash

I’ve decided that I will start reviewing some of the algorithm problems I come across while practicing on LeetCode.

Problem 1480: Running Sum of 1d Array

Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]).

Return the running sum of nums.


Input: nums = [1,2,3,4]
Output: [1,3,6,10]
Explanation: Running sum is obtained as follows: [1, 1+2, 1+2+3, 1+2+3+4].


  • 1 <= nums.length <= 1000
  • -10^6 <= nums[i] <= 10^6
var runningSum = function(nums){};

My Process

Understanding the Problem

The first thing I did before coding anything was to make sure I understood what the problem was. The examples provided did a pretty good job at…

Ajak Cyer

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