Question: I can't seem to get my head around the off-line minimum algo. Can someone explain it to me more?
Possibly with pseudo-code in a "near-code" fashion.
Say, for example, that I have the following sequence: 

```
"5","4","6","E","1","7","E","E","3","2"

```

**What are the steps to return the smallest integer in the whole set.** I understand the problem but I don't seem to find a way to code it.

Regards

Answer: 
You can do something like:-

1) Set min variable to INT\_MAX.

2) Start extracting strings one by one. If they represent integers then compare that with the min value you stored. If it's smaller than change min to that value. If it's greater than move to next element.

3) At the end you would have min element with you.
Here are some calls from the standard library which do what you asked for. They are probably not the most efficient ones.

```
std::vector<std::string> v{"5","4","6","E","1","7","E","E","3","2"};
std::vector<std::string> r{"1","2","3","4","5","6","7","8","9"};

std::sort(v.begin(), v.end());

//remove all elements which are not numbers
std::vector<std::string> v_numbers;
std::set_intersection(v.begin(), v.end(), r.begin(), r.end()
                    , std::back_inserter(v_numbers));

//find minimum element
std::string result = *std::min_element(v_numbers.begin(), v_numbers.end());
std::cout<<result<<std::endl;

```

This prints `1`.

[DEMO](http://ideone.com/e.js/sfZ8h4)

---

**EDIT:** Note that in the current form, it will work only for single-digit numbers. If that isn't sufficient, either remove all `"E"` in front of the `set_intersection` -- if `"E"` is your only letter. Or generate a string-vector `r` which ends with a larger number than `"9"`. Or do something completely different.