This file contains 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
import java.util.*; | |
class Program { | |
public static int findClosestValueInBst(BST tree, int target) { | |
return findClosestValueInBst(tree, target, tree.value); | |
} | |
public static int findClosestValueInBst(BST tree, int target, int closest){ | |
// find current and next value | |
int currentValue = Math.abs(target - closest); |
This file contains 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
#If BRANCHES_TO_SKIP is null | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP = (master) | |
fi | |
#Get branch name | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
#Set excluded branches and search on the excluded branches for | |
#branch name | |
BRANCH_EXCLUDED=$(printf "%s\n" "${BRANCHES_TO_SKIP[@]}" | grep -c "^$BRANCH_NAME") |
This file contains 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 authenticate(req, res, next){ | |
const username = req.query.username, | |
password = req.query.password | |
let preparedStatement = new sql.PreparedStatment(), | |
sqlQuery = "select * from users where (username = @username and password = @password)" | |
preparedStatement.input('username', sqlVarChar(50)) | |
preparedStatement.input('password', sqlVarChar(50)) | |
preparedStatement.prepare(sqlQuery) | |
.then(function(){ |