This text is italic
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 https = require('https'); | |
async function httpsGet(hostname, path, headers) { | |
return new Promise(async (resolve, reject) => { | |
const options = { | |
hostname: hostname, | |
path: path, | |
port: 443, | |
method: 'GET', |
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 com.facebook.react.ReactApplication ; | |
import com.facebook.react.bridge.ReactApplicationContext; | |
import com.facebook.react.ReactPackage; | |
import com.facebook.react.TurboReactPackage; | |
import com.facebook.react.bridge.NativeModule; | |
import com.facebook.react.module.model.ReactModuleInfo; | |
import com.facebook.react.module.model.ReactModuleInfoProvider; | |
import com.facebook.react.shell.MainReactPackage; |
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 ListNode(val) { | |
* this.val = val; | |
* this.next = null; | |
* } | |
*/ | |
var mergeTwoLists = function(l1, l2) { | |
const dummy = new ListNode(0); | |
let current = dummy; |
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
// Wolf | |
// - Properties | |
// -- fur color | |
// -- eye color | |
// -- size | |
// -- gender | |
// -- age | |
// - Actions | |
// -- walk/run |
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
// ===== ANSWER: | |
function solution(A) { | |
let set = new Set(); // holds a unique set of values | |
let max = 1; // largest number in set | |
let min = 1; // smallest number in set | |
let n = A.length | |
for (let i = 0; i < n; i += 1) { | |
let num = A[i]; |
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 solution(A) { | |
var zero = 0; | |
var count = 0; | |
for (var i = 0; i < A.length; i++) { | |
if (A[i] == 0) zero++; | |
else { | |
count += 1 * zero; | |
if (count > 1000000000) return -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
/* | |
Diagonal Difference Solution. | |
sample matrix = [[1,2,3], [4,5,6], [7,8,9]] | |
*/ | |
function diagonalDifference(matrix) { | |
// length of input matrix. | |
const length = matrix.length; | |
let diagonal1 = 0, diagonal2 = 0; | |
// Looping through the array and summing the diagonals. |
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 isAnagram => (s, t) { | |
var lens = s.length, | |
lent = t.length; | |
if(lens !== lent) return false; | |
if(typeof s !== 'string' || typeof t !== 'string') return false; | |
if(lens === 0 && lent === 0) return true; | |
var charmap = {}; | |
for(let i=0; i<lens; i++){ | |
charmap[s[i]] = charmap[s[i]] ? charmap[s[i]]+1: 1; |
A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
NewerOlder