MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / convert

Method convert

java/0051-n-queens.java:110–120  ·  view source on GitHub ↗
(int n, int col)

Source from the content-addressed store, hash-verified

108 }
109
110 private String convert(int n, int col) {
111 StringBuilder res = new StringBuilder();
112 for (int i = 0; i < n; i++) {
113 if (i == col) {
114 res.append("Q");
115 } else {
116 res.append(".");
117 }
118 }
119 return res.toString();
120 }
121}
122
123

Callers 1

dfsMethod · 0.95

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected