How to run

Browser
  1. Open index.html in your browser
  2. Add your inputs
  3. Hit "submit"
  4. See the results on screen, or in the dev console
Node

Run node index.js with arguments, for example, node index.js 1,2,3,4,5 2 where the first argument 1,2,3,4,5 is the array, and the second argument 2 is the target segments. Note, important you don't add spaces into the array.