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 computeLpsArray(pat) { | |
let len = 0; | |
let i = 1; | |
const lps = []; | |
lps[0] = 0; | |
while (i < pat.length) { | |
if (pat.charAt(i) === pat.charAt(len)) { | |
len++; | |
lps[i] = len; |
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
/* | |
solve this.... | |
(b)(r)(w) | |
+(b)(r)(w) | |
+(b)(r)(w) | |
---------- | |
(w)(w)(w) | |
What numbers are (b),(r),(w)? | |
*/ |
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
/* Pokes back every 2 minutes. Run in console on https://www.facebook.com/pokes/ */ | |
window.setInterval(function(){var x=document.evaluate('//*[translate(text(),"ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz")="poke back"]',document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE),i=0;for(;i<x.snapshotLength;i++)x.snapshotItem(i).click()},120000); |