This file contains 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
def string_intersection(strings, key = 0, intersection = '') | |
letter = strings.first[key] | |
return if letter.nil? | |
if strings.map {|str| str[key] == letter}.all? | |
return string_intersection(strings, key + 1, intersection + letter) | |
else | |
return intersection | |
end | |
end |
This file contains 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
$scope.$watch('myOjbect', function(curr){ | |
console.log(curr); | |
},true) |