Kechirasiz. Java funksiyasi Gray kodini amalga oshirish va berilgan koddan keyin keyingi ketma-ket kodni berilgan burilish yo'nalishida qaytarish uchun: Java: import java.util.List; import java.util.ArrayList; jamoatchilik sinfi GrayCode { jamoatchilik statik ro'yxati<Integer> grayCode{int n) { List{Integer> natija = yangi ArrayList{int n) }; result.add{(0); uchun (int i = 0; i < n; i++) { int size = result.size{(); uchun (int j = size - 1; j = > 0; j--) { result.add{(result.get{j}) 1 << i } }); } result; } public int next static sequence{{quint} code, next direction}
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence