Skip to content

Commit

Permalink
Q1523 added.
Browse files Browse the repository at this point in the history
  • Loading branch information
isinsuarici committed Mar 6, 2023
1 parent cb51a42 commit 58d3a88
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions E_1523_CountOddNumbersinanIntervalRange.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Solution {
public int countOdds(int low, int high) {
if (low%2==0 && high%2==0)
return (high-low)/2;
return (high-low)/2+1;
}
}

0 comments on commit 58d3a88

Please sign in to comment.