Skip to content

Commit

Permalink
Merge pull request #468 from avnisinngh/nine
Browse files Browse the repository at this point in the history
Create The number of positions.java
  • Loading branch information
PRIYESHSINGH24 authored Jan 21, 2025
2 parents 3ccd559 + 66b40dc commit 6ab5bd6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions LeetCode/CodeForce Solutions/The number of positions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import java.util.*;
public class The_number_of_positions {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println(n - Math.max(a+1,n-b)+1);
}
}

0 comments on commit 6ab5bd6

Please sign in to comment.