Category: FreeCodeCamp

Basic Algorithm Scripting – Check for Palindromes

Basic Algorithm Scripting – Check for Palindromes

Problem Statement (Check for Palindromes) : Return true if the given string is a palindrome. Otherwise, return false. A palindrome is a word or sentence that’s spelled the same way both forward and backward, ignoring punctuation, case, and spacing. Note: You’ll need to remove all non-alphanumeric characters(punctuation, spaces and symbols) and turn everything lower case …

+ Read More

Basic Algorithm Scripting – Factorialize a Number

Basic Algorithm Scripting – Factorialize a Number

Problem Statement (Factorialize a Number) : Return the factorial of the provided integer. If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n. Factorials are often represented with the shorthand notation n! For example: 5! = 1 * 2 * 3 …

+ Read More

Basic Algorithm Scripting – Reverse a String

Basic Algorithm Scripting – Reverse a String

Problem Statement (Reverse a string) : Reverse the provided string. You may need to turn the string into an array before you can reverse it. Your result must be a string. Solution : function reverseString(str) { return str.split(”).reverse().join(”); } Explanation : You can’t directly reverse a string, but what you could do, is convert the …

+ Read More

www.000webhost.com