Hampura abdi. Ieu fungsi Java pikeun nerapkeun kode Gray sareng mulangkeun kode sékmen salajengna saatos kode anu dipasihkeun dina arah rotasi anu dipasihkeun: Java: ngimpor java.util.List; ngimpor java.util.ArrayList; kelas publik GrayCode { daptar statis publik<Integer> grayCode n) { Daptar<Integer> hasil = anyar ArrayList<>((); hasil.add.(0); pikeun (int i = 0; i n++; i n++) {ukuran = hasil.}; pikeun (int j = ukuran - 1; j = 0; j = 0; j--) {hasil.addresult bits.getgerj) ==== i } hasil; } kode grid grid grid grid grid grid grid grid grid grid grid grid grid grid grid grid grid grid grid grid grid grid grid
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence