Skip to content

Commit 061d4cf

Browse files
committed
template for vscode json file added
1 parent e1fba7f commit 061d4cf

File tree

6 files changed

+617
-36
lines changed

6 files changed

+617
-36
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/*
2+
written by Pankaj Kumar.
3+
country:-INDIA
4+
Institute: National Institute of Technology, Uttarakhand
5+
*/
6+
typedef long long ll ;
7+
typedef unsigned long long ull;
8+
typedef vector<int> vl;
9+
typedef vector<vector<ll>> vvl;
10+
/* Abbrevations */
11+
#define ff first
12+
#define ss second
13+
#define mp make_pair
14+
#define pb push_back
15+
#define Endl "\n"
16+
#define all(V) (V).begin(),(V).end()
17+
#define srt(V) sort(all(V))
18+
#define srtGreat(V) sort(all(V),greater<ll>())
19+
// some extra
20+
#define printv(v) for(ll i=0;i<ll(v.size());i++){cout<<v[i]<<" ";} cout<<endl;
21+
#define precision(x) cout<<fixed<<setprecision(x);
22+
#define sz(V) ll(V.size())
23+
24+
/* ascii value
25+
A=65,Z=90,a=97,z=122
26+
*/
27+
/* Some syntax
28+
//Syntax to create a min heap for priority queue
29+
//priority_queue <int, vector<int>, greater<int>>pq;
30+
*/
31+
32+
33+
/* --------------------MAIN PROGRAM----------------------------*/
34+
// to run ctrl+b
35+
const ll INF=1e18;
36+
const ll mod1=1e9+7;
37+
const ll mod2=998244353;
38+
39+
// Techniques :
40+
// divide into cases, brute force, pattern finding
41+
// sort, greedy, binary search, two pointer
42+
// transform into graph
43+
44+
// Experience :
45+
// Cp is nothing but only observation and mathematics.
46+
47+
// add main code here
48+
class Solution {
49+
public:
50+
string removeDuplicates(string s) {
51+
stack<char> st;
52+
string ans="";
53+
for(auto x:s){
54+
if(sz(st)==0){
55+
st.push(x);
56+
}
57+
else{
58+
if(st.top()==x){
59+
st.pop();
60+
}
61+
else{
62+
st.push(x);
63+
}
64+
}
65+
}
66+
while(sz(st)){
67+
ans+=st.top();
68+
st.pop();
69+
}
70+
reverse(all(ans));
71+
return ans;
72+
}
73+
};
74+
75+
76+
77+
/* -----------------END OF PROGRAM --------------------*/
78+
/*
79+
* stuff you should look before submission
80+
* constraint and time limit
81+
* int overflow
82+
* special test case (n=0||n=1||n=2)
83+
* don't get stuck on one approach if you get wrong answer
84+
*/

Template/Advanced_Template(CF).cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,7 @@ string num_to_str(ll num)
6969
}
7070
// datatype definination
7171
#define ordered_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
72-
class Point
73-
{
74-
public:
75-
ll x;
76-
ll y;
77-
ll z;
78-
ll getsum()
79-
{
80-
return x+y+z;
81-
}
82-
};
72+
8373
/* ascii value
8474
A=65,Z=90,a=97,z=122
8575
*/

Template/Atcoder_Template.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,7 @@ string num_to_str(ll num)
6666
}
6767
// datatype definination
6868
#define ordered_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
69-
class Point
70-
{
71-
public:
72-
ll x;
73-
ll y;
74-
ll z;
75-
ll getsum()
76-
{
77-
return x+y+z;
78-
}
79-
};
69+
8070
/* ascii value
8171
A=65,Z=90,a=97,z=122
8272
*/

Template/KickStart_Template.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ typedef vector<vector<ll>> vvl;
1919
#define mp make_pair
2020
#define line cout<<endl;
2121
#define pb push_back
22-
#define Endl "\n"
2322
// loops
2423
#define forin(arr,n) for(ll i=0;i<n;i++) cin>>arr[i];
2524
// Some print
@@ -39,6 +38,7 @@ T mymax(T x,T y)
3938
{
4039
return (x>y)?x:y;
4140
}
41+
// Function
4242
ll power(ll x,ll y,ll mod)
4343
{
4444
ll res=1;
@@ -65,17 +65,7 @@ string num_to_str(ll num)
6565
}
6666
// datatype definination
6767
#define ordered_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
68-
class Point
69-
{
70-
public:
71-
ll x;
72-
ll y;
73-
ll z;
74-
ll getsum()
75-
{
76-
return x+y+z;
77-
}
78-
};
68+
7969
/* ascii value
8070
A=65,Z=90,a=97,z=122
8171
*/

Template/Leetcode_Template.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
typedef long long ll ;
77
typedef unsigned long long ull;
88
typedef vector<int> vl;
9-
typedef vector<vector<ll>> vvl;
9+
typedef vector<vector<int>> vvl;
1010
/* Abbrevations */
1111
#define ff first
1212
#define ss second
1313
#define mp make_pair
1414
#define pb push_back
15-
#define Endl "\n"
1615
#define all(V) (V).begin(),(V).end()
1716
#define srt(V) sort(all(V))
1817
#define srtGreat(V) sort(all(V),greater<ll>())

0 commit comments

Comments
 (0)