/**
 * Given a dictionary with article titles as keys and their contents as values,
 * count the number of positive integers present in each article.
 *
 * @param articles A dictionary with article titles as keys and their contents as values.
 * @return A dictionary with article titles as keys and the count of positive integers in each article as values.
 */
fun countWords(articles: Map<String, String>): Map<String, Int> {

    val wordCount = mutableMapOf<String, Int>()

    for ((title, content) in articles) {
        var count = 0
        var word = ""
        for (char in content) {
            if (char.isDigit()) {
                word += char
            } else if (word.isNotEmpty()) {
                if (word.toInt() > 0) {
                    count++
                }
                word = ""
            }
        }
        wordCount[title] = count
    }

    return wordCount
}
/**
 * Given a dictionary with article titles as keys and their contents as values,
 * count the number of positive integers present in each article.
 *
 * @param articles A dictionary with article titles as keys and their contents as values.
 * @return A dictionary with article titles as keys and the count of positive integers in each article as values.
 */
fun countWords(articles: Map<String, String>): Map<String, Int> {
/**
 * Given a dictionary with article titles as keys and their contents as values,
 * count the number of positive integers present in each article.
 *
 * @param articles A dictionary with article titles as keys and their contents as values.
 * @return A dictionary with article titles as keys and the count of positive integers in each article as values.
 */
fun countWords(articles: Map<String, String>): Map<String, Int> {

    val wordCount = mutableMapOf<String, Int>()

    for ((title, content) in articles) {
        var count = 0
        var word = ""
        for (char in content) {
            if (char.isDigit()) {
                word += char
            } else if (word.isNotEmpty()) {
                if (word.toInt() > 0) {
                    count++
                }
                word = ""
            }
        }
        wordCount[title] = count
    }

    return wordCount
}