Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/skygragon/leetcode-cli
/ padCenter
Function
padCenter
lib/sprintf.js:19–23 ·
view source on GitHub ↗
(s, n, c)
Source
from the content-addressed store, hash-verified
17
}
18
19
function
padCenter(s, n, c) {
20
let
k = Math.max(0, n - len(s));
21
let
r = (k - k % 2) / 2, l = k - r;
22
return
c.repeat(l) + s + c.repeat(r);
23
}
24
25
const
tsprintf =
function
() {
26
const
args = Array.from(arguments);
Callers
1
tsprintf
Function · 0.85
Calls
1
len
Function · 0.85
Tested by
no test coverage detected