+ 13

Challenge ::: Circle Dot

Description :- Assume there is a circle with n(even number) of points with marking from 0 to n-1 with equal distance. So each point have a point opposite to it. Task :- To make a code which takes a input n and input pointr(a point on circle marked). You have to find the point which is opposite to pointr. Example:- Input :- 10, 7 Output :- 7 is opposite to 2;

23rd Jan 2018, 11:40 AM
Akash Pal
Akash Pal - avatar
10 Answers
23rd Jan 2018, 11:45 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
23rd Jan 2018, 6:20 PM
LukArToDo
LukArToDo - avatar
24th Jan 2018, 12:55 PM
Abhishek Tandon
Abhishek Tandon - avatar
+ 7
https://code.sololearn.com/cddgHOa6u3Mf/?ref=app
24th Jan 2018, 4:04 AM
code learner
code learner - avatar
+ 6
@BlazingMagpie Suppose if the input is 10 and 0. The answer should be 5. But according to you it is just 9. Think before you do something. Please make a equation that satisfy all the inputs not just one.
23rd Jan 2018, 11:50 AM
Akash Pal
Akash Pal - avatar
+ 6
my oneliner!! //excluding the input line https://code.sololearn.com/clKJGW10DXxN/?ref=app
23rd Jan 2018, 9:34 PM
Saurabh Tiwari
Saurabh Tiwari - avatar
+ 6
And.....Here is the Python 😀😀 https://code.sololearn.com/cHX0Cf6ras8C/?ref=app
24th Jan 2018, 4:50 AM
Zoetic_Zeel
Zoetic_Zeel - avatar
+ 3
https://code.sololearn.com/cCq1jkXjTDpJ
24th Jan 2018, 3:35 PM
dim_knp
dim_knp - avatar
+ 2
Oh, I was imagining the circle wrong.
23rd Jan 2018, 11:48 AM
BlazingMagpie
BlazingMagpie - avatar
- 5
Isn't it just n - pointr - 1?
23rd Jan 2018, 11:34 AM
BlazingMagpie
BlazingMagpie - avatar