I hereby claim:
- I am anoopelias on github.
- I am anoopelias (https://keybase.io/anoopelias) on keybase.
- I have a public key ASBFp65xGHBRZOaP1q61K6Hvb_KSUY9TZzbbnSAh4ythugo
To claim this, I am signing this object:
import java.util.ArrayList; | |
import java.util.List; | |
/** | |
* | |
* Diameter and center of a tree. | |
* | |
* Given a connected graph with no cycles, | |
* | |
* Diameter: design a linear-time algorithm to find the longest simple path in |
10 | |
14 | |
9 3 | |
2 5 | |
6 5 | |
9 8 | |
0 3 | |
4 7 | |
2 1 | |
0 6 |
package jperftest; | |
import static org.junit.Assert.assertTrue; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.concurrent.Callable; |
import java.util.ArrayList; | |
import java.util.List; | |
class TestClass { | |
private static final int[] PRIMES = { 2, 3, 5, 7, 11, 13, 17, 19, 23 }; | |
public static void main(String args[]) throws Exception { | |
goodVsBad(23, 46, 22); | |
} |
function substring(txt, str) { | |
var dfa = compile(str); | |
var curr = 0; | |
for(var i=0; i<txt.length; i++) { | |
curr = next(dfa, curr, txt.charAt(i)); | |
if(curr === str.length) | |
return true; | |
} | |
/** | |
* __main__ | |
*/ | |
var bot; | |
var botId; | |
var lenColumns; | |
var lenRows; |
use std::cmp::max; | |
fn largest2(arr: [i32; 5]) -> i32 { | |
arr.iter().fold(0, |num, &x| { | |
max(num, x) | |
}) | |
} | |
fn largest3(arr: [i32; 5]) -> i32 { | |
arr.iter().fold(0, max) // Do Not compile! |
I hereby claim:
To claim this, I am signing this object:
package main | |
import ( | |
"bufio" | |
"fmt" | |
"net" | |
"strconv" | |
"strings" | |
) |