Skip to content

izavits/js-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

js-practice

License PRs Welcome

A set of Javascript exercises for practice.

Table of Contents

Exercises

  • BFS.js - Breath First Search.
  • anagrams.js - Given an array of strings, return all groups of strings that are anagrams.
  • bSearch.js - Binary search.
  • bubbleSort.js - Sort an array using the bubble sorting method.
  • comparison.js - Given a member name string, return a comparison function that can be used to sort an array of objects that contain that member.
  • countAndSay.js - Given an integer n, generate the nth sequence (1,11,21,1211,...)
  • dataStrucures.js - Collection of various data structures.
  • evaluateExpr.js - Evaluate an expression.
  • exceptions.js - Simple exception throwing example.
  • fizzbuzz.js - The classic fizzbuzz exercise.
  • flatten.js - Given an array of objects, flatten it to a simple array.
  • fourSum.js - Given an array of integers, are there elements a,b,c,d such that a+b+c+d=target?
  • hanoi.js - The famous Hanoi discs.
  • isomorphicStr.js - Test if two strings are isomorphic.
  • kthLargestElem.js - Find the k-th largest element in unsorted array.
  • largestRectangle.js - Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.
  • longestValidParenthesis.js - Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.
  • majorityElem.js - Given an array of size n, find the majority element (the one that appears more than n/2 times).
  • memoization.js - Memoization examples.
  • overlapIntervals.js - Merge all overlapping intervals.
  • palindromeStr.js - Check if a string is palindrome.
  • recursion.js - Various recursion examples.
  • removeElem.js - Given an array and a value, remove all instances of that value in place and return the new length.
  • rotateArray.js - Rotate array on n elements to the right by k.
  • scope.js - Variable scope simple example.
  • summaryRanges.js - Given a sorted integer array without duplicates, return the summary of its ranges for consecutive numbers.
  • threeSumZero.js - Given an array of integers, are there three elements a,b,c such that a+b+c=0?
  • twoSum.js - Given an array of integers, find two numbers that they add up to a specific target.
  • wildcharMatch.js - Wildchar pattern matching with support for ? and *.

Support

If you're having any problem, please raise an issue on GitHub.

Contributing

PRs accepted. Some general guidelines:

  • Write a concise commit message explaining your changes.
  • If applies, write more descriptive information in the commit body.
  • Refer to the issue/s your pull request fixes (if there are issues in the github repo).
  • Write a descriptive pull request title.
  • Squash commits when possible.

Before your pull request can be merged, the following conditions must hold:

  • All the tests passes (if any).
  • The coding style aligns with the project's convention.
  • Your changes are confirmed to be working.

Small note: If editing the Readme, please conform to the standard-readme specification.

License

The project is licensed under the Apache-2.0 license.