久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='Y8dTP'></tfoot>

    <bdo id='Y8dTP'></bdo><ul id='Y8dTP'></ul>
    1. <small id='Y8dTP'></small><noframes id='Y8dTP'>

        <legend id='Y8dTP'><style id='Y8dTP'><dir id='Y8dTP'><q id='Y8dTP'></q></dir></style></legend>
        <i id='Y8dTP'><tr id='Y8dTP'><dt id='Y8dTP'><q id='Y8dTP'><span id='Y8dTP'><b id='Y8dTP'><form id='Y8dTP'><ins id='Y8dTP'></ins><ul id='Y8dTP'></ul><sub id='Y8dTP'></sub></form><legend id='Y8dTP'></legend><bdo id='Y8dTP'><pre id='Y8dTP'><center id='Y8dTP'></center></pre></bdo></b><th id='Y8dTP'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Y8dTP'><tfoot id='Y8dTP'></tfoot><dl id='Y8dTP'><fieldset id='Y8dTP'></fieldset></dl></div>
      1. 如何在保留重復(fù)項(xiàng)的同時(shí)進(jìn)行整數(shù)列表交集?

        How do I do an integer list intersection while keeping duplicates?(如何在保留重復(fù)項(xiàng)的同時(shí)進(jìn)行整數(shù)列表交集?)
          <bdo id='cvuod'></bdo><ul id='cvuod'></ul>

            <tfoot id='cvuod'></tfoot>

                <tbody id='cvuod'></tbody>
              • <i id='cvuod'><tr id='cvuod'><dt id='cvuod'><q id='cvuod'><span id='cvuod'><b id='cvuod'><form id='cvuod'><ins id='cvuod'></ins><ul id='cvuod'></ul><sub id='cvuod'></sub></form><legend id='cvuod'></legend><bdo id='cvuod'><pre id='cvuod'><center id='cvuod'></center></pre></bdo></b><th id='cvuod'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='cvuod'><tfoot id='cvuod'></tfoot><dl id='cvuod'><fieldset id='cvuod'></fieldset></dl></div>
                  <legend id='cvuod'><style id='cvuod'><dir id='cvuod'><q id='cvuod'></q></dir></style></legend>
                • <small id='cvuod'></small><noframes id='cvuod'>

                  本文介紹了如何在保留重復(fù)項(xiàng)的同時(shí)進(jìn)行整數(shù)列表交集?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我正在處理最大公因數(shù)和最小公因數(shù)分配,我必須列出公因數(shù).Intersection() 將不起作用,因?yàn)樗鼤?huì)刪除重復(fù)項(xiàng).Contains() 將不起作用,因?yàn)槿绻诘诙€(gè)列表中看到 int,它會(huì)從第一個(gè)列表中返回所有匹配的 int.有沒(méi)有辦法做一個(gè)不相干的交叉點(diǎn)?

                  I'm working on a Greatest Common Factor and Least Common Multiple assignment and I have to list the common factors. Intersection() won't work because that removes duplicates. Contains() won't work because if it sees the int in the second list it returns all matching ints from the first list. Is there a way to do an Intersection that is not Distinct?

                  抱歉沒(méi)有提供示例,這就是我的意思:

                  edit: sorry for not providing an example, here is what I meant:

                  如果我有套裝:

                  {1, 2, 2, 2, 3, 3, 4, 5}
                  {1, 1, 2, 2, 3, 3, 3, 4, 4}
                  

                  我想要輸出

                  {1, 2, 2, 3, 3, 4}
                  

                  推薦答案

                  ILookup<int, int> lookup1 = list1.ToLookup(i => i);
                  ILookup<int, int> lookup2 = list2.ToLookup(i => i);
                  
                  int[] result =
                  (
                    from group1 in lookup1
                    let group2 = lookup2[group1.Key]
                    where group2.Any()
                    let smallerGroup = group1.Count() < group2.Count() ? group1 : group2
                    from i in smallerGroup
                    select i
                  ).ToArray();
                  

                  where 表達(dá)式在技術(shù)上是可選的,我覺(jué)得它使意圖更清晰.

                  The where expression is technically optional, I feel it makes the intent clearer.

                  如果你想要更簡(jiǎn)潔的代碼:

                  If you want more terse code:

                  ILookup<int, int> lookup2 = list2.ToLookup(i => i);
                  
                  int[] result =
                  (
                    from group1 in list1.GroupBy(i => i)
                    let group2 = lookup2[group1.Key]
                    from i in (group1.Count() < group2.Count() ? group1 : group2)
                    select i
                  ).ToArray();
                  

                  這篇關(guān)于如何在保留重復(fù)項(xiàng)的同時(shí)進(jìn)行整數(shù)列表交集?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Ignore whitespace while reading XML(讀取 XML 時(shí)忽略空格)
                  XML to LINQ with Checking Null Elements(帶有檢查空元素的 XML 到 LINQ)
                  Reading XML with unclosed tags in C#(在 C# 中讀取帶有未閉合標(biāo)簽的 XML)
                  Parsing tables, cells with Html agility in C#(在 C# 中使用 Html 敏捷性解析表格、單元格)
                  delete element from xml using LINQ(使用 LINQ 從 xml 中刪除元素)
                  Parse malformed XML(解析格式錯(cuò)誤的 XML)
                  <tfoot id='TL1hG'></tfoot>

                      <tbody id='TL1hG'></tbody>
                    <i id='TL1hG'><tr id='TL1hG'><dt id='TL1hG'><q id='TL1hG'><span id='TL1hG'><b id='TL1hG'><form id='TL1hG'><ins id='TL1hG'></ins><ul id='TL1hG'></ul><sub id='TL1hG'></sub></form><legend id='TL1hG'></legend><bdo id='TL1hG'><pre id='TL1hG'><center id='TL1hG'></center></pre></bdo></b><th id='TL1hG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='TL1hG'><tfoot id='TL1hG'></tfoot><dl id='TL1hG'><fieldset id='TL1hG'></fieldset></dl></div>
                        <legend id='TL1hG'><style id='TL1hG'><dir id='TL1hG'><q id='TL1hG'></q></dir></style></legend>

                          <small id='TL1hG'></small><noframes id='TL1hG'>

                            <bdo id='TL1hG'></bdo><ul id='TL1hG'></ul>
                          • 主站蜘蛛池模板: av影音| 国产在线视频一区二区董小宛性色 | 成人在线视频免费观看 | 欧美色综合一区二区三区 | 欧美理伦片在线播放 | 在线视频91| 国产成人影院 | 欧美一级片在线播放 | 伊人一区 | 成人免费久久 | 超碰在线人人干 | 免费人成激情视频在线观看冫 | 久久亚洲综合 | 免费观看色 | 日韩精品一区二区三区四区 | 欧美精品欧美精品系列 | 久久久.com| 午夜精品久久久久久久久久久久 | 久久国产美女视频 | 久久69精品久久久久久久电影好 | 日韩av一区二区在线观看 | 亚洲精品一区二区三区蜜桃久 | 婷婷在线视频 | 成人性视频免费网站 | 国产精品爱久久久久久久 | 日韩精品一区二区三区在线播放 | 91在线观看 | 狠狠爱视频 | 国产.com | 91视频播放 | 亚洲精品久久久久久下一站 | 国产精品久久久久久久久久免费 | 日本精品一区二区三区视频 | 一级在线观看 | 欧美在线观看网站 | 狠狠狠干 | 免费在线视频一区二区 | 成人国产精品免费观看 | 免费成人毛片 | 亚洲精品免费在线观看 | 国产做a爱片久久毛片 |