title: scheme: Finding the sum of the two largest digits in an integer
body: <p>I've been stuck on this question for a while, any hints or suggestions would be helpful. I want to find the sum of the two largest digits in a number using Scheme and I want to do it recursively, for which I think I need a helper functions, but I don't know what will this helper function do. I was able to solve the same problem in a iterative way, but I want to do it in an recursive way. Any hints or suggestions would be helpful.</p>
  <p>Here's my iterative solution to the same problem:</p>
  <pre><code>(define (largest-sum n)
    (define (largest-sum-iter num largest second_largest)
  
      (cond ((= num 0) (+ largest second_largest))
            ((&gt;= (remainder num 10) largest) (largest-sum-iter (quotient num 10) (remainder num 10) largest))
  
            ((and (&lt; (remainder num 10) largest) (&gt;= (remainder num 10) second_largest)) (largest-sum-iter (quotient num 10) largest (remainder num 10)))
  
            (else (largest-sum-iter (quotient num 10) largest second_largest))))
  
    (largest-sum-iter n 0 0))
  </code></pre>