Skip to content

Instantly share code, notes, and snippets.

@nickbalestra
Last active April 7, 2018 02:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickbalestra/40b366ec49c92b4ff18d038c40ca986b to your computer and use it in GitHub Desktop.
Save nickbalestra/40b366ec49c92b4ff18d038c40ca986b to your computer and use it in GitHub Desktop.
TwoSum Jest Workshop Example
/*
* Two Sum
*
* Given an array of integers, return indices of the two numbers
* such that they add up to a specific target.
*
* You may assume that each input would have exactly one solution,
* and you may not use the same element twice.
*
* Example:
* Input: nums = [2, 7], target = 9,
* Output: [0, 1] // Because nums[0] + nums[1] = 2 + 7 = 9,
*
* Follow-up: What will change if the given array of integers is sorted
*
*/
const twoSum = (nums, target) => {};
module.exports = twoSum;
const twoSum = require('./twoSum')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment