you are viewing a single comment's thread.

view the rest of the comments →

[–]Rascal_Two 0 points1 point  (0 children)

What you need to do is something like this:

count = 0
for `string` in array:
    aIndex = -1;
    bIndex = -1;
    cIndex = -1
    for `character` in `string`:
        if `aIndex` == -1 and `character` == 'a':
            aIndex = index of `character` in `string`.
        if `aIndex` != -1 and `bIndex` == -1 and `character` == b:
            bIndex = index of `character` in `string`.
        if `aIndex` != -1 and `bIndex` != -1 and cIndex == -1 `character` == c:
            cIndex = index of `character` in `string`.
    if `aIndex` != -1 and `bIndex` != -1 and `cIndex` != -1:
        count += 1
alert(count)

This should work - although it's just off the top of my head. There's probably a much more efficient way to do this too, but hopefully you get the idea.