MCPcopy Create free account
hub / github.com/algorithmzuo/algorithm-journey / printXor

Method printXor

src/class136/ShowDetails.java:217–225  ·  view source on GitHub ↗
(long[] nums, int n)

Source from the content-addressed store, hash-verified

215 // 所有可能的异或和打印出来
216 // 要求去重并且至少选择一个数字
217 public static void printXor(long[] nums, int n) {
218 HashSet<Long> set = new HashSet<>();
219 dfs(nums, n, 1, false, 0, set);
220 System.out.println("至少选择一个数字所有可能的异或和:");
221 for (Long s : set) {
222 System.out.print(s + ", ");
223 }
224 System.out.println();
225 }
226
227 // 当前来到i位置
228 // 之前是否选择过数字用pick表示

Callers 1

mainMethod · 0.95

Calls 3

dfsMethod · 0.95
printlnMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected