Hello Guys,
I am working on how can I speed up the way to write code. We all are used trigger based snippet pasting.
Example : dsu — > Enter
Codell parent[200000 + 10], siz[200000 + 10];
ll findParent(ll i)
{
if (i == parent[i])
return i;
parent[i] = findParent(parent[i]);
return parent[i];
}
void unionNodes(ll a, ll b)
{
ll parent_a = findParent(a), parent_b = findParent(b);
if (parent_a == parent_b)
return;
if (siz[parent_a] >= siz[parent_b]) {
swap(parent_a, parent_b);
}
siz[parent_b] += siz[parent_a];
parent[parent_a] = parent_b;
}
void cleardsu(ll n) {
for (ll i = 0; i <= n; i++) {
parent[i] = i;
siz[i] = 1;
}
}
In a same way we also use if-else conditions or sometimes we want to change our #define template during the contest,
If-Else
if(something1 || something2)
{
if(something1 && something2)
{
}
else
{
if(something1)
{
}
else
{
}
}
}
else
{
}
//idk comment if you know any easy way to handle this
#define
#define fo(a,b) for(int i=a;i<b;i++)
for(int i=0;i<b && j<something;i++)
//what if we get directly for loop printed instead of #define so we can edit it later
Free Tools I found till now (Windows):
1.AutoText (https://www.jitbit.com/autotext/) //I know there is already function on Sublime for it but sometimes we code on online platforms (LeetCode) so it would be helpful there.
2.Magical and other Text Expander they are for only chrome not Machine
I am just asking for If anyone knows any software which can we make dynamic code snippets or somneone could make Sublime extention for it so it would be helpful for all of us.
What I want :
Trigger : ifel(something1,something2) — > Enter
If-Else
if(something1 || something2)
{
if(something1 && something2)
{
}
else
{
if(something1)
{
}
else
{
}
}
}
else
{
}
Full text and comments »