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
apiVersion: networking.k8s.io/v1beta1 | |
kind: Ingress | |
metadata: | |
name: ingress-{{ .Release.Name }}-frontend | |
namespace: {{ .Release.Name }} | |
annotations: | |
kubernetes.io/ingress.class: "nginx-3" | |
nginx.ingress.kubernetes.io/auth-tls-verify-client: "on" | |
nginx.ingress.kubernetes.io/auth-tls-secret: {{ .Release.Name }}/tls-secret | |
nginx.ingress.kubernetes.io/auth-tls-verify-depth: "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
function getAnagram( word, string ) { | |
let t1 = performance.now() | |
let res = []; | |
let word_array = word.split( '' ); | |
for ( let i of [ ...Array( string.length - word.length + 1 ).keys() ] ) { | |
let a_window = string.substring( i, i + word.length ); | |
let a_window_array = a_window.split( '' ); | |
if ( JSON.stringify( word_array ) == JSON.stringify( a_window_array ) || | |
JSON.stringify( word_array ) == JSON.stringify( a_window_array.reverse() ) | |
) { |
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
function smallElementsToTheRight(array){ //straightforward | |
let t0 = performance.now(); | |
let res= array.map((x, i) => { | |
return array.slice(i, array.length).map(y => y < x).reduce((acc,curr)=>{return acc + curr;},0); | |
}); | |
let t1 = performance.now(); | |
let t = t1 - t0; | |
return {res, t}; | |
} |
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
function maxSumSubArray(array){ | |
let res = 0; | |
let sum = 0; | |
let starting_index = 0; | |
let ending_index = 0; | |
for(let i = 0, l = array.length; i < l; i++){ | |
sum = Math.max(array[i], sum + array[i]); | |
if(sum > res){ | |
ending_index = i + 1; | |
res = sum; |
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
function wind(array){ | |
let t = performance.now(); | |
let left=null, right = null; | |
let s = [...array].sort(); | |
for(let [i,v] of array.entries()){ | |
if(v != s[i] && left == null){ | |
left = i; | |
}else if (v != s[i]){ | |
right = i; | |
} |
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
//their solution | |
function products(nums){ | |
var t0 = performance.now(); | |
let prefix_products = []; | |
for(let num of nums){ | |
if(prefix_products.length){ | |
prefix_products.push(prefix_products[prefix_products.length - 1] * num); | |
}else{ | |
prefix_products.push(num) | |
} |