For a binary string $S$ (i.e. a string of 0 's and 1's) that contains at least one 0 , we produce a binary string $f(S)$ as follows:
- If the substring 110 occurs in $S$, replace each instance of 110 with 01 to produce $f(S)$;
- Otherwise, replace the leftmost occurrence of 0 in $S$ by 1 to produce $f(S)$.
Given binary string $S$ of length $n$, we define the lifetime of $S$ to be the number of times $f$ can be applied to $S$ until the resulting string contains no more 0 's. For example,
$$
To determine which binary string(s) of length \( n \) have the longest lifetime, we need to analyze the transformation rules and their effects on the string. Let's break down the steps and reasoning:

1. **Transformation Rules**:
   - If the substring \( 110 \) occurs in \( S \), replace each instance of \( 110 \) with \( 01 \).
   - Otherwise, replace the leftmost occurrence of \( 0 \) in \( S \) by \( 1 \).

2. **Initial Observations**:
   - The transformation \( 110 \to 01 \) reduces the number of characters in the string by 1.
   - Replacing the leftmost \( 0 \) with \( 1 \) does not change the length of the string but reduces the number of \( 0 \)'s by 1.

3. **Example Analysis**:
   Consider the example \( 111000 \):
   \[
   111000 \to 10100 \to 11100 \to 1010 \to 1110 \to 101 \to 111
   \]
   The lifetime of \( 111000 \) is 6.

4. **General Strategy**:
   - To maximize the lifetime, we need to maximize the number of transformations.
   - The transformation \( 110 \to 01 \) is more efficient in reducing the number of \( 0 \)'s while also reducing the length of the string.
   - Therefore, we should aim to create as many \( 110 \) substrings as possible.

5. **Constructing the String**:
   - To maximize the number of \( 110 \) substrings, we can alternate between \( 1 \) and \( 0 \) as much as possible.
   - For a string of length \( n \), the pattern \( 110110110\ldots \) will ensure the maximum number of \( 110 \) substrings.

6. **Detailed Calculation**:
   - For \( n = 2 \), the possible strings are \( 10 \) and \( 01 \). Both have a lifetime of 1.
   - For \( n = 3 \), the string \( 110 \) has a lifetime of 2.
   - For \( n = 4 \), the string \( 1101 \) has a lifetime of 3.
   - For \( n = 5 \), the string \( 11011 \) has a lifetime of 4.
   - For \( n = 6 \), the string \( 110110 \) has a lifetime of 5.

7. **General Pattern**:
   - For \( n \ge 2 \), the string \( 110110110\ldots \) (repeating \( 110 \) as much as possible) will have the longest lifetime.
   - The lifetime of such a string can be calculated as follows:
     - Each \( 110 \) substring reduces the length by 1 and the number of \( 0 \)'s by 1.
     - The number of \( 110 \) substrings in a string of length \( n \) is approximately \( \frac{n}{3} \).

8. **Conclusion**:
   - The binary string of length \( n \) that has the longest lifetime is the one that maximizes the number of \( 110 \) substrings.
   - For \( n \ge 2 \), the string \( 110110110\ldots \) (repeating \( 110 \) as much as possible) has the longest lifetime.

The final answer is \( \boxed{ 110110110\ldots } \) (repeating \( 110 \) as much as possible) for \( n \ge 2 \).