title: Merge items in list based on condition
body: <p>I have a list which looks like:</p>
  <pre><code>a = [&quot;/n abc&quot;, &quot;def&quot;, &quot;ghi&quot;, &quot;/n jkl&quot;, &quot;mno&quot;, &quot;/n pqr&quot;, &quot;/n stu&quot;]
  </code></pre>
  <p>I want it to look like this:</p>
  <pre><code>a = [&quot;abcdefghi&quot;, &quot;jklmno&quot; &quot;pqr&quot; &quot;stu&quot;] 
  </code></pre>
  <p>Essentially, what I want the code to do is merge items in the list with the item sequentially below until it encounters an element with the substring &quot;/n&quot;. It should do this for the entire list and then remove all instances of the substring &quot;/n &quot;</p>