My attempt:
val areas = mutableListOf<mutableMapOf<Double, Double>()>()
On mutableListOf it shows an error Function invocation 'mutableListOf(...)' expected
CodePudding user response:
mutableMapOf<Double, Double>() is a function call that creates a map. You need to first create a list and only specify the type of its items, which is: MutableMap<Double, Double>:
val areas = mutableListOf<MutableMap<Double, Double>>()
Then you can add maps to it:
areas = mutableMapOf(1.0 to 1.0)
