VS Code CPP,C++,C Competitive Coding Snippets
This extension provide you C and C++ Competitive Coding snippets used frequently to ease and speed up your skills with VS Code
Installation
Visual Studio Marketplace
Launch Quick Open:
Paste the following command and press Enter :
ext install slayersumit.ccsnippets
MarketPlace
Here is direct link to marketplace CCSnippets
Supported languages (file extensions)
Snippets info
Every space inside { } and ( ) means that this is pushed into next line :)
$ represent each step after tab .
Template
Prefix |
Method |
cptemplate-> |
CP template |
Mathematics
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 |
Graph
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 |
DSA
Prefix |
Method |
DSU-> |
Disjoint union data structures |
inversions-> |
inversions |
Segment Tree
Prefix |
Method |
lazy_segtree-> |
lazy_segment tree |
segtree-> |
segment tree |
Dynamic Programming
Prefix |
Method |
01knapsack-> |
0-1 Knapsack |
lis-> |
Longest increasing subsequence |
subsetSum-> |
subset sum possible |
String
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 |
Known Issues
No Issues till now
Release Notes
New Version with many more codes to help
1.2.0
Adding many more snippets to extension
Enjoy!
| |