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
#include <iostream> | |
#include <fstream> | |
#include <map> | |
#include <vector> | |
#include <algorithm> | |
#include <sstream> | |
#include <chrono> | |
#include <set> | |
using namespace std::chrono; |
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
#!/bin/bash | |
current_branch=$(git branch | grep "*" | awk '{ print $2 }') | |
git checkout $1 | |
git pull | |
git checkout $current_branch | |
git merge $1 |
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
#include <stdio.h> | |
int binary_search(int arr[], size_t start, size_t end, int needle) { | |
if (start > end) { | |
return -1; | |
} | |
size_t mid = start + ((end - start) / 2); | |
if (arr[mid] == needle) { |
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
public static Map<Integer, List<TreeNode>> getTreeLevels(TreeNode root) { | |
Map<Integer, List<TreeNode>> treeLevels = new HashMap<>(); | |
DFS(root, 0, treeLevels); | |
return treeLevels; | |
} | |
public static void DFS(TreeNode root, int level, Map<Integer, List<TreeNode>> levelMap) { | |
if (root == null) { |
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
/* | |
Find the common nodes between multiple nodes | |
*/ | |
public static boolean allNodesChildren(TreeNode root, List<TreeNode> nodes) { | |
for (TreeNode node : nodes) { | |
TreeNode common = findCommonNode(root, root, node); | |
if (common == null) { | |
return false; | |
} |
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
public static TreeNode findCommonNode(TreeNode root, TreeNode node1, TreeNode node2) { | |
if (root == null) { | |
return null; | |
} | |
TreeNode foundInLeft = findCommonNode(root.left, node1, node2); | |
if (foundInLeft != null) { | |
return foundInLeft; | |
} |
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
package io.kubeless; | |
import io.kubeless.Event; | |
import io.kubeless.Context; | |
public class test-sum-1 { | |
public String main(io.kubeless.Event event, io.kubeless.Context context) { | |
return "Hello world!"; | |
} | |
} |
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
empty_cell = -1 | |
right_diag = 0 | |
left_diag = 1 | |
grid_width = grid_height = 3 | |
target = 6 | |
top_left_corner_offset = 0 | |
top_right_corner_offset = 1 | |
bottom_right_corner_offset = 5 | |
bottom_left_corner_offset = 4 |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>AnimalShelter</title> | |
<base href="/"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="icon" type="image/x-icon" href="favicon.ico"> | |
</head> | |
<body> |
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
const fs = require('fs-extra'); | |
const concat = require('concat'); | |
(async function build() { | |
const fileNames = ['runtime', 'polyfills', 'main', 'styles']; | |
const jsVersion = ['es5', 'es2015']; | |
const pathToFiles = './dist/animal-list'; | |
const files = []; | |
fileNames.forEach(fn => { | |
jsVersion.forEach(jsver => { |