Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
//retunr 1 , if there exits a certain group of Z numbers selected from the array | |
//such that their sum equals N | |
//HackerRank passing 13/14 | |
exports.isSumPossibleZ = function(A, n, Z) { | |
var sum = function(A, pastSums, Z){ | |
//each execution run 2 by default, so Z is Z-2 | |
Z = Z-2; | |
if(Z <= 0){ | |
Z = 0; | |
} |
//HackerRank 2/4 | |
exports.isSumPossible = function (A, n) { | |
//exceptions | |
var exception1 = A.length<2; | |
var exception2 = !(A instanceof Array) | |
var exception3 = A instanceof Number | |
if(exception1 || exception2 || exception3){ | |
return 0 | |
} | |
//combinate |
just wanted to make sure my last message dind't slip thourgh the cracks. | |
Would you mind letting me know if it's of interest? NO worries if not :) |
php artisan make:migration create_nerds_table --table=nerds --create | |
php artisan make:model Nerd | |
php artisan make:controller NerdController | |
php artisan route:list | |
php artisan serve | |
php artisan config:cache | |
composer dump-auto or composer dump-auto -o | |
2. php artisan cache:clear | |
3. php artisan config:clear |
{ | |
"dependencies": { | |
"babel-cli": "^6.0.0", | |
"babel-preset-es2015": "^6.0.0" | |
}, | |
"scripts": { | |
"start": "babel-node --presets es2015 ./app.js" | |
} | |
} |
function braces(arrBraces) { | |
var result = [] | |
for (var i = arrBraces.length - 1; i >= 0; i--) { | |
var strBraces = arrBraces[i]; | |
result.push(checkBalance(strBraces)); | |
}; | |
return result.reverse() | |
}; | |
function swap(a,b){ | |
return a^=b, b^=a, a^=b; | |
} |
// http://stackoverflow.com/questions/518000/is-javascript-a-pass-by-reference-or-pass-by-value-language | |
// https://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_sharing | |
'use strict' | |
var swap = function(a, b){ | |
var c = a; | |
b = a; | |
a = b; | |
}; |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
var graphToArray = function (listNode, memo) { | |
//run once | |
if(listNode.next == null){ | |
memo.push(listNode.val) | |
return memo; | |
} | |
//go down | |
//but memo here call stacks above the current one | |
return memo.concat(graphToArray(listNode.next, memo)) | |
}; |