Skip to content

Commit a303aca

Browse files
authoredOct 23, 2021
clean up readme file
1 parent 00fd399 commit a303aca

File tree

1 file changed

+28
-21
lines changed
  • Practice Problems/Stack/Maximum Element

1 file changed

+28
-21
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
11
# Maximum Element
2-
### Problem from Hackerrank Practice > DataStructures > Stacks
2+
**Problem from Hackerrank**
33

44
You have an empty sequence, and you will be given **N** queries. Each query is one of these three types:
55

6-
- 1 x -Push the element x into the stack.
7-
- 2 -Delete the element present at the top of the stack.
8-
- 3 -Print the maximum element in the stack.
6+
1. Push the element `x` into the stack.
7+
2. Delete the element present at the top of the stack.
8+
3. Print the maximum element in the stack.
99

10-
The first line of input contains an integer, **N** . The next **N** lines each contain an above mentioned query. (It is guaranteed that each query is valid.)
10+
The first line of input contains an integer, `N` . The next `N` lines each contain an above mentioned query. (It is guaranteed that each query is valid.)
1111

12-
## Example:
13-
### Input:<br>
14-
10<br>
15-
1 97<br>
16-
2<br>
17-
1 20<br>
18-
2<br>
19-
1 26<br>
20-
1 20<br>
21-
2<br>
22-
3<br>
23-
1 91<br>
24-
3<br>
12+
### **Example**
2513

26-
### Output:<br>
27-
26<br>
28-
91<br>
14+
**Input**:
15+
16+
``` java
17+
10
18+
1 97
19+
2
20+
1 20
21+
2
22+
1 26
23+
1 20
24+
2
25+
3
26+
1 91
27+
3
28+
```
29+
30+
**Output:**:
31+
32+
``` java
33+
26
34+
91
35+
```

0 commit comments

Comments
 (0)
Failed to load comments.