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
class Solution: | |
# @param s, an input string | |
# @param p, a pattern string | |
# @return a boolean | |
def isMatch(self, s, p): | |
s_len = len(s) | |
p_len = len(p) | |
dp = [[None for j in xrange(p_len + 1)] for i in xrange(2)] | |
# init | |
dp[0][0] = True |
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
#!/bin/bash | |
# Script for installing tmux on systems where you don't have root access. | |
# tmux will be installed in $HOME/bin. | |
# It's assumed that wget and a C/C++ compiler are installed. | |
# exit on error | |
set -e | |
TMUX_VERSION=2.0 |
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
{ | |
"template": "sfly-preprod-checksum-*", | |
"settings" : { | |
"number_of_shards" : 5, | |
"number_of_replicas" : 1 | |
}, | |
"mappings": { | |
"_default_": { | |
"_all": { "enabled": false }, | |
"_source": { "includes": ["@signature"] }, |
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
{ | |
"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 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 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 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 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 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 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)); |
NewerOlder