# DataWeave programming challenge #1: Add numbers separated by paragraphs and get the max number

> Sum the numbers within each paragraph of a text input, then return the largest paragraph total — all in DataWeave. Clues and full solutions are in the companion article.

- **Watch:** https://www.youtube.com/watch?v=JviC_4lSQEk
- **Page:** https://prostdev.com/video/dataweave-challenge-1-add-numbers-paragraphs-max
- **Series:** DataWeave Challenges

## About this video

Sum the numbers within each paragraph of a text input, then return the largest paragraph total — all in DataWeave. Clues and full solutions are in the companion article.

## Resources

- [Read the article](https://www.prostdev.com/post/dataweave-programming-challenge-1)
- [Solve on the Playground](https://dataweave.mulesoft.com/learn/playground?projectMethod=GHRepo&repo=alexandramartinez%2Fdataweave-challenges&path=challenges%2F1)

## Transcript

### Intro

Hi everyone, my name is Alex Martinez, I am the founder of ProstDev, and today I bring to you the very first DataWeave challenge. You may have already seen the blog post that went out, but if not, this is the video representation of the same challenge in case you want me to explain it to you in video. So let's do this.

### The challenge

We have this input payload, which is a text — we have a series of numbers separated by paragraphs. This is one paragraph, this is the second paragraph, this is a third paragraph, and so on.

So what we're going to do is that we are going to count each paragraph separately. The first paragraph would be 2 + 1 = 3, the second paragraph would be 3 + 4 + 5 = 12, and the third paragraph would be 15, and so on with the rest of them.

After you have those numbers, you are going to check which paragraph is the highest number. In this case it's 29, but you would have to figure that out in the script, not manually. So that's it for this challenge — you would have to generate the code to get to this 29 somehow.

### Clues and solutions

If you need clues, you can go to the comments from the video, or you can go to the link where the whole challenge is written in a blog post, and there you'll be able to see some clues if you don't want to see the answer right away because you want to keep trying — the clues are going to help you get there. Or, if you're done with it and you're just ready to see the different answers that I provided for you, you can just go ahead and scroll down to the end and you'll be able to see the different solutions that I created for you.

That's it. This is challenge number one — it's posted for the several challenges that I'm going to be releasing over the next few weeks. Good luck!