MCPcopy Create free account
hub / github.com/LjyYano/LeetCode / L0089_GrayCode

Class L0089_GrayCode

src/main/java/L0089_GrayCode.java:38–102  ·  view source on GitHub ↗

https://leetcode.cn/problems/gray-code/ n 位格雷码序列 是一个由 2ⁿ 个整数组成的序列,其中: 1. 每个整数都在范围 [0, 2ⁿ - 1] 内(含 0 和 2ⁿ - 1) 2. 第一个整数是 0 3. 一个整数在序列中出现 不超过一次 4. 每对 相邻 整数的二进制表示 恰好一位不同 ,且 5. 第一个和最后一个整数的二进制表示 恰好一位不同 给你一个整数 n ,返回任一有效的 n 位格雷码序列 。 示例 1: 输入:n = 2 输出:[0,1,3,2] 解释: [0,1,3,2] 的二进制表示是 [00,01,11,10] 。 - 00

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected