$ Install Node.js (Puppeteer requires at least Node v6.4.0)
$ Install puppeteer
$ node query.js > output.txt
private boolean sumsToTarget(int[] arr, int k) { | |
Map<Integer, Integer> map = new HashMap<>(); | |
for (int i = 0; i < nums.length; i++) { | |
int complement = target - nums[i]; | |
if (map.containsKey(complement)) { | |
return new int[] { map.get(complement), i }; | |
} | |
map.put(nums[i], i); | |
} | |
throw new IllegalArgumentException("No two sum solution"); |
private boolean sumsToTarget(int[] arr, int k) { | |
HashSet values = new HashSet(); | |
for (int i = 0; i < arr.length; i++) { | |
if (values.contains(k - A[i])) return true; | |
values.add(A[i]); | |
} | |
return false; | |
} |
private boolean sumsToTarget(int[] arr, int k) { | |
Arrays.sort(arr); | |
int lhs = 0, rhs = arr.length - 1; | |
while (lhs < rhs) { | |
int sum = arr[lhs] + arr[rhs]; | |
if (sum == k) | |
return true; | |
else if (sum < k) | |
lhs++; | |
else rhs--; |
private boolean sumsToTarget(int[] arr, int k) { | |
Arrays.sort(arr); | |
for (int i = 0; i < arr.length; i++) { | |
int siblingIndex = Arrays.binarySearch(arr, k - A[i]); | |
if (siblingIndex >= 0) { | |
// Found it! | |
if (siblingIndex != i || (i > 0 && arr[i-1] == arr[i]) || (i < arr.length - 1 && arr[i+1] == arr[i])) | |
{ return true; } | |
} | |
} |
private boolean sumsToTarget(int[] arr, int k) { | |
for (int i = 0; i < arr.length; i++) { | |
for (int j = i + 1; j < arr.length; j++) { | |
if (arr[i] + arr[j] == k) { | |
return true; | |
} | |
} | |
} | |
return false; | |
} |
ccopy_reg | |
_reconstructor | |
p0 | |
(csklearn.pipeline | |
Pipeline | |
p1 | |
c__builtin__ | |
object | |
p2 | |
Ntp3 |
table peers : { A : client, B : channel ( string ) , C : string} | |
PRIMARY KEY A | |
table random : {C : string} | |
sequence seq | |
fun increment a = nextval seq | |
fun main () = |
$ Install Node.js (Puppeteer requires at least Node v6.4.0)
$ Install puppeteer
$ node query.js > output.txt
[ | |
"xterm-inate", | |
"DEADBEEF", | |
"hackslash", | |
"SQL Injectors", | |
"Hexspeak", | |
"The Brogrammers", | |
"GitHub Says What?", | |
"Bits Please", | |
"SaaStar", |
public class Solution { | |
public int maxSubArray(int[] nums) { | |
if(nums.length == 0){ | |
return 0; | |
} | |
int[] sum = new int[nums.length]; | |
int[] indices = new int[nums.length]; | |
sum[0] = nums[0]; | |
indices[0] = 0; | |
for(int i = 1 ; i < nums.length ; ++i){ |