This extension provide you C and C++ Competitive Coding snippets used frequently to ease and speed up your skills with VS Code
Launch Quick Open:
Paste the following command and press Enter:
ext install slayersumit.ccsnippetsHere is direct link to marketplace CCSnippets
- C++ (.cpp, .c++)
- C (.c)
Every space inside { } and ( ) means that this is pushed into next line :)
$ represent each step after tab.
| Prefix | Method |
|---|---|
cptemplate-> |
CP template |
| Prefix | Method |
|---|---|
isPowerOfTwo-> |
Check number is power of two |
isPrime-> |
Check number is prime |
primeFactors-> |
return all prime factors |
countDivisors-> |
count of all divisors |
divisorFunction-> |
sum of all divisors |
nFactorial-> |
return n! |
nFactorialMOD-> |
return n!%mod |
nextPowerOfTwo-> |
next power of two |
prevPowerOfTwo-> |
prev power of two |
xpowery-> |
x^y |
xpoweryMOD-> |
(x^y)%mod |
sieve-> |
sieve of eratosthenes |
combinatorics-> |
Combinatorics |
topologicalSort-> |
topological sort |
| Prefix | Method |
|---|---|
cycleInUnDirectedGraph-> |
Check cycle in undirected Graph |
cycleInDirectedGraph-> |
Check cycle in directed Graph |
dijkstra-> |
Dijkstra shortest path algorithm |
bellmanFord-> |
Bellman Ford shortest path algorithm |
detectNegativeCycle-> |
Detect negative cycle |
bridge_cutvertices-> |
bridges & cut vertices |
| Prefix | Method |
|---|---|
DSU-> |
Disjoint union data structures |
inversions-> |
inversions |
| Prefix | Method |
|---|---|
lazy_segtree-> |
lazy_segment tree |
segtree-> |
segment tree |
| Prefix | Method |
|---|---|
01knapsack-> |
0-1 Knapsack |
lis-> |
Longest increasing subsequence |
subsetSum-> |
subset sum possible |
| Prefix | Method |
|---|---|
palindrome-> |
palindrome-String |
pangram-> |
pangram-string |
anagram-> |
anagram-strings |
strtodec-> |
string->decimal |
dectostr-> |
decimal->string |
kmp-> |
occurences of pattern in a string |
distict_characters-> |
count of unique characters in a string |
lc_subsequence-> |
longest common subsequence of two strings |
lc_substring-> |
longest common substring of two strings |
No Issues till now
New Version with many more codes to help
Adding many more snippets to extension
Enjoy!