{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "5ff96998f4e641eaa92a22aff18f151d",
  "keywords": "算法初阶,基础知识,分治策略,最大子数组问题",
  "title": "请问如何用python做两个数组逐位判断？",
  "desc": [
    {
      "content": "\n比如有以下数组：\na1:   1,0,0,1,0,0,0,1\na2:   0,0,0,0,1,1,1,1\na3:   0,1,0,1,0,1,0,0\na4:   1,0,1,1,1,1,0,0\na5:   .......\n抓取三个数组进行判断，\nif ((a1第一位or a2第一位 or a3第一位=1 )and (a1第二位 or a2 第二位 or a3第二位=1）and....\n直到判断完所有位数为止，所有位都有了1的话就输出当前这三个数组，已输出的数组不参与之后的判断。",
      "language": "markdown"
    }
  ],
  "answer": [
    {
      "content": "",
      "language": "python"
    }
  ],
  "prepared": [
    [
      {
        "content": "",
        "language": "python"
      }
    ],
    [
      {
        "content": "",
        "language": "python"
      }
    ],
    [
      {
        "content": "",
        "language": "python"
      }
    ]
  ],
  "template": {
    "content": "# -*- coding: UTF-8 -*-\nfrom itertools import combinations\na1=[ 1,0,0,1,0,0,0,1]\na2=[ 0,0,0,0,1,1,1,1]\na3=[ 0,1,0,1,0,1,0,0]\na4=[ 1,0,1,1,1,1,0,0]\na5=[ 1,1,1,1,1,1,1,0]\na6=[ 0,0,0,0,0,0,0,1]\na=[a1,a2,a3,a4,a5,a6]\nal = list(combinations(a,3))\nfor i in al:\n\tflag = True\n\tfor j in range(len(i[0])):\n\t\tif (i[0][j] + i[1][j] + i[2][j] == 0):\n\t\t\tflag = False\n\t\t\tbreak\n\tif flag:\n\t\tprint(i)\t",
    "language": "python"
  },
  "node_id": "dailycode-94df85e9dbd04a8cb60cec11aa9b170a",
  "license": "csdn.net",
  "created_at": 1637894161,
  "topic_link": "https://bbs.csdn.net/topics/600469990"
}