JavaScriptmas is a 24-day long, daily coding challenge organized by the Norwegian online coding school, Scrimba, starting from December 1st until December 24th, 2020. It strictly consists of JavaScript exercises, as its name suggests.
In this repository I committed all my solutions to the exercises. My certificate of completion can be viewed on LinkedIn.
Scrimba's Advent Calendar containing all of the exercises can be found here.
n children have got m pieces of candy. They want to eat as much candy as they can, but each child must eat exactly the same amount of candy as any other child. Determine how many pieces of candy will be eatin by all the children together. Individual pieces of candy cannot be split.
Solution here.
You have deposited a specific amount of dollars into your ban account. Each year your balance increases at the same growth rate. Found out how long it would take for yout balance to pass a specific threshold with the assumption that you don't make any additional deposits.
Solution here.
Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a two-dimensional array.
Solution here.
Given a year, return the century it is in. The first century spans from the year 1 up to and including the year 100. The second from the year 101 up to and including the year 200, etc.
Solution here.
Reverse the provided string. You may need to turn the string into an array before you reverse it. Your result must be a string.
Solution here.
Given an array of strings, sort them in the order of increasing lengths. If two strings have them same length, their relative order must be the same as in the initial array.
Solution here.
You are given a string s that consist of only lowercase English letters. If vowels ('a', 'e', 'i', 'o', 'u') are given a value of 1 and consonants are given a value of 2, return the sum of all of the letters in the input string.
Solution here.
In this challenge a casino has asked you to make an online dice that works just like it would in real life. Using the pre-made dice face that represents โoneโ, make the faces for โtwoโ, โthreeโ, โfourโ, โfiveโ and โsixโ. Now, when the users click the dice on the screen, the dice is expected to show one of the faces randomly.
Solution here.
Given a positive integer num, return the sum of all odd Fibonacci numbers that are less than or equal to num. The first two numbers in the Fibonacci sequence are 1 and 1. Every additional number in the sequence is the sum of the two previous numbers. The first six numbers of the Fibonacci sequence are 1,1,2,3,5 and 8.
Solution here.
Given an array of integers, find the pair of adjacent elements that has the largest product and return that product.
Solution here.
You are given an array of integers representing coordinates of obstacles situated on a straight line. Assume that you are jumping from the point with coordinate 0 to the right. Ypu are allowed only to make jumps of the same length represented by some integer. Find the minimal length of the jump enough to avoid all the obstacles.
Solution here.
Check if the given string is a correct time representation of the 24-hour clock.
Solution here.
Given an array of integers, remove each kth element from it.
Solution here.
Given an array of integers, find the maximal absolute difference between any two of its adjacent elements.
Solution here.
- Use JS to make the carousel function
- Left & right arrows should work
- Bonus: use CSS transitions
Solution here.
Transform a given sentence into a new one with dashes between each two consecutive letters.
Solution here.
Given a string, find the number of different characters in it.
Solution here.
Given an array of integers, for each position i, search among the previous positions for the last (from the left) position that contains a smaller value. Store that value at position i in the answer. If no such value can be found, store -1 instead.
Solution here.
Check whether the given string is a subsequence of the plaintext alphabet.
Solution here.
GoDaddy makes a lot of different top-level domains available to its customers. A top-level domain is one that goes directly after the last dot ('.') in the domain name, for example, .com in example.com. To help the users choose from available domains, GoDaddy is introducing a new feature that shows the type of the chosen top-level domain. You have to implement this feature. To begin with, you want to write a function that labels the domains as "commercial", "organization", "network", or "information" for .com, .org, .net or .info, respectively. For the given list of domains, return the list of their labels.
Solution here.
You have two integer arrays, and b, and an integer target value v. Determine whether there is a pair of numbers, where one is taken from a and the other from b that can be added together to get a sum of v. Return true if such a pair exists, otherwise return false.
Solution here.
Given a rectangular matrix and an integer column, return an array containing the elements of the columnth column of the give matrix (the leftmost column is the 0th one).
Solution here.
We are making a Social Media Character Counter! We want to display the available characters LEFT. Using the keydown() event should help you here. When the characters reach 20 and below, we want them to turn red. So we will use Javascript to add that styling to it. If the characters drop below 0, we want the button to be disabled BUT if there are only 0 characters left, we should still be able to tweet.
Solution here.
Make a counter that increments every 75 miliseconds in the spin() function and displays whether the player wins or loses in the stop() function.
Solution here.