language: Ruby (ruby-1.9.3)
date: 500 days 11 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
@string_store = ['foo']
@hash_store = {}
 
for string in @string_store do
  for c in 0...string.length
    index_to_sum=0
    while c+index_to_sum<string.length do
      substring=string[c..(c+index_to_sum)]         
      unless @hash_store[substring]=='X'
        @hash_store[substring]='X'
      end
      index_to_sum+=1
    end
  end
end
 
p @hash_store.keys