How can I compare two lists in Groovy

后端 未结 4 1593
北海茫月
北海茫月 2020-12-15 04:33

How can I compare the items in two lists and create a new list with the difference in Groovy?

4条回答
  •  盖世英雄少女心
    2020-12-15 05:16

    If it is a list of numbers, you can do this:

    def before = [0, 0, 1, 0]
    def after = [0, 1, 1, 0]
    def difference =[]
    for (def i=0; i<4; i++){
        difference<

提交回复
热议问题