/**
 * Given a list of elements and a string of minerals, this function
 * returns the count of each mineral present in the elements list.
 *
 * @param elements A list of elements.
 * @param minerals A string of minerals.
 * @return A dictionary containing the count of each mineral in the elements list.
 */
fun countMinerals(elements: List<String>, minerals: String): Map<Char, Int> {

    val mineralCount = mutableMapOf<Char, Int>()

    for (mineral in minerals) {
        var count = 0
        for (element in elements) {
            if (mineral in element) {
                count++
            }
        }
        mineralCount[mineral] = count
    }

    return mineralCount
}
/**
 * Given a list of elements and a string of minerals, this function
 * returns the count of each mineral present in the elements list.
 *
 * @param elements A list of elements.
 * @param minerals A string of minerals.
 * @return A dictionary containing the count of each mineral in the elements list.
 */
fun countMinerals(elements: List<String>, minerals: String): Map<Char, Int> {
/**
 * Given a list of elements and a string of minerals, this function
 * returns the count of each mineral present in the elements list.
 *
 * @param elements A list of elements.
 * @param minerals A string of minerals.
 * @return A dictionary containing the count of each mineral in the elements list.
 */
fun countMinerals(elements: List<String>, minerals: String): Map<Char, Int> {

    val mineralCount = mutableMapOf<Char, Int>()

    for (mineral in minerals) {
        var count = 0
        for (element in elements) {
            if (mineral in element) {
                count++
            }
        }
        mineralCount[mineral] = count
    }

    return mineralCount
}