Skip to content

Instantly share code, notes, and snippets.

View sotch-pr35mac's full-sized avatar

Preston Wang-Stosur-Bassett sotch-pr35mac

View GitHub Profile
@jaewook77
jaewook77 / lcs.js
Created July 8, 2014 21:05
JavaScript: Algorithm: DP: Longest Common Subsequence (LCS)
// http://en.wikipedia.org/wiki/Longest_common_subsequence_problem
//
function lcs_recursive(a, b) {
var aSub = a.substr(0, a.length-1);
var bSub = b.substr(0, b.length-1);
if (a.length == 0 || b.length == 0) {
return "";
} else if (a.charAt(a.length-1) == b.charAt(b.length-1)) {
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",