Skip to content

Commit

Permalink
Create 24.03.2024.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Masked-coder11 authored Mar 23, 2024
1 parent 4be6c14 commit 3ea3c21
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions 24.03.2024.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//User function Template for C++

class Solution{
public:
stack<int> insertAtBottom(stack<int> st,int x){
stack<int>aux;
while(!st.empty()){
aux.push(st.top());
st.pop();
}

st.push(x);

while(!aux.empty()){
st.push(aux.top());
aux.pop();
}
return st;
}
};

0 comments on commit 3ea3c21

Please sign in to comment.