From 66b40dc9b928fcb78f33865d2c72b43677bfd8b7 Mon Sep 17 00:00:00 2001 From: Avni Singh Date: Tue, 21 Jan 2025 22:40:07 +0530 Subject: [PATCH] Create The number of positions.java adding in codeforces solution --- .../CodeForce Solutions/The number of positions.java | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 LeetCode/CodeForce Solutions/The number of positions.java diff --git a/LeetCode/CodeForce Solutions/The number of positions.java b/LeetCode/CodeForce Solutions/The number of positions.java new file mode 100644 index 00000000..79a01d57 --- /dev/null +++ b/LeetCode/CodeForce Solutions/The number of positions.java @@ -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); + } +}