cd ~
sudo apt-get update
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
apt-get purge python-virtualenv python3-virtualenv virtualenv
pip install virtualenv
mv /.pip/pip.conf /.pip/pip.conf.backup
sudo ./certbot-auto --no-self-upgrade --nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void buildTreeMinSum(int *a, int *tree, int start, int end, int treeNode) | |
{ | |
if (start == end) | |
{ | |
tree[treeNode] = a[start]; | |
return; | |
} | |
int mid = (start + end) / 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
#include <math.h> | |
using namespace std; | |
/* | |
Square Root Decomposition is used for "Range Querying" with the Time Complexity of O(sqrt(n)). | |
We Decompose the array into 'ceil(sqrt(n))' blocks. We calculate the result for each Block and store them. | |
When Updating (given the index), we change the value at that index to the new value. We also have to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int Solve(vector<int> a) { | |
map<int, int> mp; | |
For (int t=0;t<a.size();++t) { | |
++mp[a[t]]; | |
If (mp[a[t]] > 1) return a[t]; | |
} | |
Return -1; | |
} |