Input: {param1=[x1,y1], param2=[p1,q1],param3=[m1,n1]....}
Output: [{param1=x1, param2=p1,param3=m1....},{param1=y1, param2=q1,param3=n1....}]
我需要将此输入Map<String,List<String>>
转换为List<Map<String,String>>
任何帮助表示赞赏。您的帮助可以节省我的时间。.谢谢
val source =
mapOf("param1" to listOf("x1", "y1"),
"param2" to listOf("p1", "q1"))
val result = source.values.first().indices.map { index ->
source.entries.associate { (param, list) -> param to list[index] }
}