Skip to content

Instantly share code, notes, and snippets.

View sefields's full-sized avatar

Sam sefields

  • Sacramento, California, USA
View GitHub Profile
@sefields
sefields / solution.js
Created November 14, 2017 20:09
Reddit DailyProgrammer Solution 2017-11-13
// Prompt: https://www.reddit.com/r/dailyprogrammer/comments/7cnqtw/20171113_challenge_340_easy_first_recurring/
// Solution 1:
// This solution is 0-indexed.
// In the worst case scenario, this creates and checks a number
// of substrings equal to the length of inputStr. Not very efficient.
function firstRecurring(inputStr) {
var charArr = inputStr.split('');
for (var i = 0; i < charArr.length; i++) {