Last active
April 7, 2018 02:34
-
-
Save nickbalestra/40b366ec49c92b4ff18d038c40ca986b to your computer and use it in GitHub Desktop.
TwoSum Jest Workshop Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const twoSum = require('./twoSum') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment