카타 8급 Will there be enough space?

1 C[ | ]

int enough(int cap, int on, int wait) {
  int res = on+wait-cap;
  return (res<0)? 0: res;
}
int enough(int cap, int on, int wait) {
  return (on + wait > cap) ? on + wait - cap : 0 ;
}

2 Python[ | ]

def enough(cap, on, wait):
    return max(0, on + wait - cap)
def enough(cap, on, wait):
    res = on+wait-cap
    if res<0: return 0
    return res
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}