Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/Tiwarishashwat/InterviewCodes
/ increment
Method
increment
DesignAStackWithIncrements.java:39–45 ·
view source on GitHub ↗
(int k, int val)
Source
from the content-addressed store, hash-verified
37
}
38
39
public
void
increment(
int
k,
int
val) {
40
if
(isEmpty()){
41
return
;
42
}
43
int
num = Math.min(size,k);
44
operations[num-1] += val;
45
}
46
47
private
boolean isFull(){
48
return
(size == capacity);
Callers
nothing calls this directly
Calls
1
isEmpty
Method · 0.95
Tested by
no test coverage detected