Skip to content

Commit 1e3a36d

Browse files
committed
added essentials in Solution1.cpp
1 parent fd43652 commit 1e3a36d

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Problems/Mathematics/Day-01/sol/Lavay Garg/Solution1.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
/*# PROBLEM STATEMENT :
2+
3+
There are **n people** standing in a circle. They are numbered from **1 to n** in a clockwise order. The circle is **even** (i.e. *n* is even).
4+
5+
Each person is looking at the person standing exactly opposite him in the circle.
6+
7+
You are given three **distinct** integers **a**, **b**, and **c**. It is known that person **a** is looking at person **b**.
8+
9+
Determine the number of the person that person **c** is looking at.
10+
If there are **multiple answers**, print **any** of them.
11+
If there is **no answer**, print **-1**.*/
12+
/*## Example
13+
14+
### Input
15+
```
16+
7
17+
6 2 4
18+
2 3 1
19+
2 4 10
20+
5 3 4
21+
1 3 2
22+
2 5 4
23+
4 3 2
24+
```
25+
26+
27+
### Output
28+
```
29+
8
30+
-1
31+
-1
32+
-1
33+
4
34+
1
35+
-1
36+
```*/
137
#include <bits/stdc++.h>
238
using namespace std;
339

@@ -22,3 +58,5 @@ int main() {
2258
}
2359
}
2460
}
61+
//Time complexity =O(t)
62+
//Space complexity=O(1)

0 commit comments

Comments
 (0)