Leetcode in Java && Oracle
421 subscribers
8 photos
397 files
400 links
Second channel: @codeforces_java

Let's Develop Together!
Download Telegram
image_2021-11-01_15-39-39.png
24 KB
#N1688. Count of Matches in Tournament
problem link=>https://leetcode.com/problems/count-of-matches-in-tournament/

#solution
class Solution {
public int numberOfMatches(int n) {
int matches=0;
while(n>1){
matches+=n/2;
n-=n/2;
}

return matches;
}
}