{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "1815b9aa7eeb4aec927a3b93ad258801",
  "keywords": "图算法,算法高阶,最小生成树,最小生成树的形成",
  "title": "生成随机字符串",
  "desc": [
    {
      "content": "\n生成一个由大写字母和数字组成的6位随机字符串，并且字符串不重复",
      "language": "markdown"
    }
  ],
  "answer": [
    {
      "content": "",
      "language": "java"
    }
  ],
  "prepared": [
    [
      {
        "content": "",
        "language": "java"
      }
    ],
    [
      {
        "content": "",
        "language": "java"
      }
    ],
    [
      {
        "content": "",
        "language": "java"
      }
    ]
  ],
  "template": {
    "content": "class java_384519 {\n\tpublic static char[] generate() {\n\tchar[] letters = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',\n\t\t'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };\n\tboolean[] flags = new boolean[letters.length];\n\tchar[] chs = new char[6];\n\tfor (int i = 0; i < chs.length; i++) {\n\t  int index;\n\t  do {\n\t\tindex = (int) (Math.random() * (letters.length));\n\t  } while (flags[index]);\n\t  chs[i] = letters[index];\n\t  flags[index] = true;\n\t}\n\treturn chs;\n  }\n}",
    "language": "java"
  },
  "node_id": "dailycode-4599bbc177164a5fbac3c9116aee0c05",
  "license": "csdn.net",
  "created_at": 1637894161,
  "topic_link": "https://bbs.csdn.net/topics/600470188"
}