What do you want to save?
Add Code snippet
New code examples
-
Other 2022-03-16 19:40:15
vertical traversal of binary tree gfg
void getVerticalOrder(TreeNode* root, int hd, map<int, vector<int>> &mp) { // Base case if (root == NULL) return; mp[hd].push_back(root->val); getVerticalOrder(root->left, hd-1, mp); getVerticalOrder... Add solution -
C++ 2022-03-16 14:50:10
array header, <array>
#include <iostream> #include <array> using namespace std; int main() { array<int,3> myarray {10,20,30}; for (int i=0; i<myarray.size(); ++i) ++myarray[i]; for (int elem : myarray) cout << elem << '\n'; } Add solution -
Python 2022-03-14 15:50:16
Set a Widget size to the parent size from python in kivy
A widget keeps a reference to its parent in self.parent. So you can just use self.parent.size or self.parent.pos or whatever. Depending on what you're doing, it may be necessary or useful to make sure you check if self.parent is None first, so that you... Add solution -
C++ 2022-03-12 02:30:03
prims c++
#include <iostream> #include <vector> #include <queue> #include <functional> #include <utility> using namespace std; const int MAX = 1e4 + 5; typedef pair<long long, int> PII; bool marked[MAX]; vector <PII> adj[M... Add solution -
Other 2022-03-12 01:15:13
word matching from a subsequence
#include <bits/stdc++.h> using namespace std; class Solution { public: int numMatchingSubseq(string S, vector<string>& words) { int n = words.size(); map <char, vector ... Add solution -
Python 2022-03-09 14:45:13
selenium finding elements
from selenium import webdriver chrome_driver_path = 'C:\Development\chromedriver.exe' driver = webdriver.Chrome(executable_path=chrome_driver_path) driver.get('https://www.python.org') name = driver.find_element_by_name('q') print(name.get_attribute('p... Add solution