In this video I'll be taking you step by step in detail how I solved the "Search and Replace" challenge in 5 easy steps using javascript on FreeCodeCamp.
The steps I took to complete this challenge are as follows(I go into more detail in the video):
STEP 1
Get the sum of all the numbers leading up to n.
Create an empty array.
STEP 2
start a for loop starting from the top and decreasing as long as it's greater than 0.
STEP 3
Create an equation for the second number.
STEP 4
Make sure the second number is less than n and that it is an integer.
STEP 5
Push an array of the two digits into the array from step one.
Useful links:
Number.isInteger(): https://goo.gl/79FEu9
multidimensional array: https://goo.gl/UPrFGe
for loop: https://goo.gl/Lt115A
Download
0 formats
No download links available.
codewars javascript - Is my friend cheating? - SOLVED IN 5 EASY STEPS! | NatokHD