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
// 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++) { |