Code Monkey home page Code Monkey logo

javascript-algorithms's Introduction

JavaScript-Algorithms

Algorithm challenges with solutions in JavaScript

List of algorithms:

  • Ceasar cipher
  • Symmetric difference
  • String peeler
  • Diamond
  • Vowel counter
  • Palindrome
  • Two sum
  • Leap year
  • Anagram
  • No duplicate
  • Capitalize
  • Bubble sort
  • Camel case
  • Friend list
  • Missing letter

Contributing Guide

javascript-algorithms's People

Contributors

ian-yy avatar vaibhav-yadav-1998 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

javascript-algorithms's Issues

Solve capitalize algorithm

Create a function that takes an array of names and returns an array with the first letter capitalized.

Examples

capitalize(["mavis", "senaida", "letty"]) ➞ ["Mavis", "Senaida", "Letty"]

capitalize(["samuel", "MABELLE", "letitia", "meridith"]) ➞ ["Samuel", "Mabelle", "Letitia", "Meridith"]

capitalize(["Slyvia", "Kristal", "Sharilyn", "Calista"]) ➞ ["Slyvia", "Kristal", "Sharilyn", "Calista"]

Notes

Don't change the order of the original array.
Notice in the second example above, "MABELLE" is returned as "Mabelle".

After writing the solution run npm run capitalize-test to test your solution

Please read the contribution guide before submitting your pull request

drop a comment here before submitting your pull request

source: edabit.com

Solve no-duplicate algorithm

A set is a collection of unique items. A set can be formed from an array from removing all duplicate items.

[1, 3, 3, 5, 5, 5]
// original array

[1, 3, 5]
// original array transformed into a set

Create a function that transforms an array into a set.

Examples

noDuplicate([1, 3, 3, 5, 5]) ➞ [1, 3, 5]

noDuplicate([4, 4, 4, 4]) ➞ [4]

noDuplicate([5, 7, 8, 9, 10, 15]) ➞ [5, 7, 8, 9, 10, 15]

Notes

Note: For this question, output an array, not a set. These are two distinctly different data structures in Javascript (although they can be converted from one to the other).

Note: After writing the solution run npm run no-duplicate-test

Note: Before submitting the pull request please read the contribution guide.

source: eadabit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.