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
{
}
Try this snippet
where and how can I use tht?
You can use it as a Sublime snippet
Wow Perfectly what am looking for,
Thank You so much Master <3
Problems am still facing :
Works till $1 only.
Available on sublime only not for Machine as software.
Can you help me with these problems?
For understanding of others how its working :
Add this snippet in your sublime and link with any trigger you want.
It will automatically point Textfield cursor to every place where $1 was written.
After entering the text for $1 press tab and it should move the selection to $2
"Ek hi to Dil hai Ivan Ji kitni baar jeetoge" it means in english "There is only one heart. How many times will you win? " <3
Thank you so much bro
you overcomplicated the code for ifel
you can just do this