/**
 * This function calculates the design style for an interior designer based on the given points and preferences.
 *
 * @param points A nested list containing the points. The outer list represents the various design elements, and the inner lists represent the points for each design element.
 * @param preferences A nested list containing the preferences. The outer list represents the various design styles, and the inner lists represent the preferences for each design style.
 * @return A string indicating the design style that best matches the given points and preferences.
 */
fun calculateDesignStyle(points: List<List<Int>>, preferences: List<List<Int>>): String {

    var totalPoints = 0
    val designScore = IntArray(preferences.size)

    for (i in points.indices) {
        totalPoints += points[i].sum()

        for (j in preferences.indices) {
            designScore[j] += points[i].mapIndexed { k, value -> value * preferences[j][k] }.sum()
        }
    }

    return if (designScore[0] > designScore[1] && designScore[0] > designScore[2]) {
        "Modern"
    } else if (designScore[1] > designScore[0] && designScore[1] > designScore[2]) {
        "Contemporary"
    } else {
        "Other"
    }
}
/**
 * This function calculates the design style for an interior designer based on the given points and preferences.
 *
 * @param points A nested list containing the points. The outer list represents the various design elements, and the inner lists represent the points for each design element.
 * @param preferences A nested list containing the preferences. The outer list represents the various design styles, and the inner lists represent the preferences for each design style.
 * @return A string indicating the design style that best matches the given points and preferences.
 */
fun calculateDesignStyle(points: List<List<Int>>, preferences: List<List<Int>>): String {
/**
 * This function calculates the design style for an interior designer based on the given points and preferences.
 *
 * @param points A nested list containing the points. The outer list represents the various design elements, and the inner lists represent the points for each design element.
 * @param preferences A nested list containing the preferences. The outer list represents the various design styles, and the inner lists represent the preferences for each design style.
 * @return A string indicating the design style that best matches the given points and preferences.
 */
fun calculateDesignStyle(points: List<List<Int>>, preferences: List<List<Int>>): String {

    var totalPoints = 0
    val designScore = IntArray(preferences.size)

    for (i in points.indices) {
        totalPoints += points[i].sum()

        for (j in preferences.indices) {
            designScore[j] += points[i].mapIndexed { k, value -> value * preferences[j][k] }.sum()
        }
    }

    return if (designScore[0] > designScore[1] && designScore[0] > designScore[2]) {
        "Modern"
    } else if (designScore[1] > designScore[0] && designScore[1] > designScore[2]) {
        "Contemporary"
    } else {
        "Other"
    }
}