This file contains hidden or 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
| class Solution { | |
| public: | |
| int longestConsecutive(vector<int> &num) { | |
| // Start typing your C/C++ solution below | |
| // DO NOT write int main() function | |
| unordered_map<int, int> map; | |
| int res = 1; | |
| for(int i = 0; i < num.size(); ++i) { | |
| int cur = num[i]; | |
| if(map.find(cur) != map.end()) { |
This file contains hidden or 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
| class Solution { | |
| public: | |
| double pow(double x, int n) { | |
| // Start typing your C/C++ solution below | |
| // DO NOT write int main() function | |
| if(n == 0) { | |
| return 1; | |
| } | |
This file contains hidden or 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
| class Solution { | |
| public: | |
| int dp[100][10000]; | |
| string S; | |
| string T; | |
| int numDistinct(string S, string T) { | |
| // Start typing your C/C++ solution below | |
| // DO NOT write int main() function | |
| memset(dp, -1, sizeof(dp)); |
This file contains hidden or 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
| class Solution { | |
| public: | |
| vector<vector<int> > res; | |
| vector<int> cur; | |
| vector<vector<int> > threeSum(vector<int> &num) { | |
| res.clear(); | |
| cur.clear(); | |
| sort(num.begin(), num.end()); | |
| solve(num, 0, 0, 0); | |
| return res; |
This file contains hidden or 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
| class Solution { | |
| public: | |
| string addBinary(string a, string b) { | |
| string c; | |
| int lenA = a.length() - 1; | |
| int lenB = b.length() - 1; | |
| int left = 0; | |
| while(lenA >= 0 or lenB >= 0 or left != 0) { | |
| int tmpA = lenA >= 0 ? a[lenA] - '0' : 0; | |
| int tmpB = lenB >= 0 ? b[lenB] - '0' : 0; |
This file contains hidden or 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
| class Solution { | |
| private: | |
| vector<int> tmp; | |
| public: | |
| int largestRectangleArea(vector<int> &height) { | |
| this->tmp = height; | |
| if(height.size() == 0) { | |
| return 0; | |
| } | |
This file contains hidden or 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
| class Solution { | |
| public: | |
| string longestCommonPrefix(vector<string> &strs) { | |
| if(strs.size() == 0) { | |
| return ""; | |
| } | |
| string prefix; | |
| int index = 0; | |
| while(true) { |
This file contains hidden or 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
| require 'formula' | |
| class Jsdoc3 < Formula | |
| homepage 'http://usejsdoc.org/' | |
| url 'https://github.com/jsdoc3/jsdoc/archive/releases/3.2.zip' | |
| def install | |
| libexec.install Dir['*'] | |
| # Custom invoker that just passes on whatever arguments you give it | |
| system "/bin/echo '#!/bin/sh' > jsdoc" |
This file contains hidden or 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
| { | |
| "template": "sfly-preprod-logs-*", | |
| "settings" : { | |
| "number_of_shards" : 5, | |
| "number_of_replicas" : 1, | |
| "index" : { | |
| "query" : { "default_field" : "@message" }, | |
| "store" : { "compress" : { "stored" : true, "tv": true } } | |
| } | |
| }, |
This file contains hidden or 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
| { | |
| "template": "sfly-preprod-checksum-*", | |
| "settings" : { | |
| "number_of_shards" : 5, | |
| "number_of_replicas" : 1 | |
| }, | |
| "mappings": { | |
| "_default_": { | |
| "_all": { "enabled": false }, | |
| "_source": { "includes": ["@signature"] }, |