Question: I created a solution to [this](https://leetcode.com/problems/repeated-dna-sequences/) problem on leetcode: 

> 
> All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to identify repeated sequences within the DNA.
> 
> 
> Write a function to find all the 10-letter-long sequences (substrings) that occur more than once in a DNA molecule.
> 
> 
> 

My solution causes an **out of memory exception**:

```
class Solution:
    # @param {string} s
    # @return {string[]}
    def findRepeatedDnaSequences(self, s):
        seen_so_far = set()
        results = set()
        for seq in self.window(10, s):
            if seq in seen_so_far:
                results.add(seq)
            else:
                seen_so_far.add(seq)
        return list(results)

    def window(self, window_size, array):
        window_start = 0
        window_end = window_size
        while window_end < len(array):
            yield array[window_start:window_end+1]
            window_end += window_size

```

**This solution works:**

```
class Solution:
    # @param {string} s
    # @return {string[]}
    def findRepeatedDnaSequences(self, s):
        d = {}
        res = []
        for i in range(len(s)):
            key = s[i:i+10]
            if key not in d:
                d[key] = 1
            else:
                d[key] += 1

        for e in d:
            if d[e] > 1:
                res.append(e)

        return res

```

**They seem essentially the same. What am I missing?**

Answer: 
First of all you need to fix the class names that missed '-' in your jQuery code.

If you want to get the .col-1 height you can do it in several ways, that I will discuss later.

Before that in each case you need to write a function that gives .col-1 height and set .col-2 . 

```
$(document).ready(function() {

    function set_heights(){
        var divHeight = $('.col-1').height(); 
        $('.col-2').css('min-height', divHeight+'px');
    }

});

```

Then you just call the function whenever you need...

Some of different ways are :

1. to set interval or timer to call above function once in a period of time you need.

```
setInterval(function(){  set_heights(); }, 100);

```
2. use resize event for .col-1 . to call above function when ever .col-1 changed.

```
$('.col-1').resize(function(){
    set_heights();
});

```
3. use bind

> 
> remember!!! for responsive design you need too call above function even when window resized !
> 
> 
> 

Good luck !
```
$('.col-2').css({'minHeight': divHeight+'px'});

```

you can place this in a callback. so it is executed when height is changed.
like this [Detecting when a div's height changes using jQuery](https://stackoverflow.com/questions/172821/detecting-when-a-divs-height-changes-using-jquery)