Skip to content

coder-candace/CodeWars-WhereIsVasya

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WhereIsVasya-CodeWars

Description:

Vasya stands in line with number of people p (including Vasya), but he doesn't know exactly which position he occupies. He can say that there are no less than b people standing in front of him and no more than a people standing behind him. Find the number of different positions Vasya can occupy.

Input

As an input you have 3 numbers:

  1. Total amount of people in the line;

  2. Number of people standing in front of him

  3. Number of people standing behind him

Examples:

Line.WhereIsHe(3, 1, 1) // => 2 The possible positions are: 2 and 3

Line.WhereIsHe(5, 2, 3) // => 3 The possible positions are: 3, 4 and 5

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages