title: Haskell: Minimum sum of list
body: <p>So, I'm new here, and I would like to ask 2 questions about some code:</p>
  
  <ol>
  <li><p>Duplicate each element in list by n times. For example, duplicate <code>[1,2,3]</code> should give <code>[1,2,2,3,3,3]</code></p>
  
  <pre><code>duplicate1 xs = x*x ++ duplicate1 xs
  </code></pre>
  
  <p>What is wrong in here?</p></li>
  <li><p>Take positive numbers from list and find the minimum positive subtraction. For example, <code>[-2,-1,0,1,3]</code> should give <code>1</code> because <code>(1-0)</code> is the lowest difference above <code>0</code>.</p></li>
  </ol>