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
class Dequeue() { | |
/** | |
Construct a dequeue of the form: | |
B F | |
--------------------- | |
e/d e/d | |
--------------------- | |
*/ | |
private queue: number[]; |
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 max(nums: number[]): number { | |
return nums.reduce((p,v) => {return p>v? p:v;}) | |
} | |
function min(nums: number[]): number { | |
return nums.reduce((p,v) => {return p<v? p:v;}) | |
} |
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 binarySearch(numbers: number[], target: number): number { | |
let low: number = 0; | |
let high: number = numbers.length - 1; | |
while (low <= high) { | |
let mid = Math.floor((low + high) / 2); | |
if (target < numbers[mid]) { | |
high = mid - 1; | |
} else if (target > numbers[mid]) { | |
low = mid + 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
library(limma) | |
library(edgeR) | |
library(sva) | |
library(ggplot2) | |
library(tidyr) | |
library(broom) | |
library(dplyr) | |
library(ggpubr) | |
library(biomaRt) | |
options(stringsAsFactors = F) |
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 requests | |
from bs4 import BeautifulSoup | |
from time import sleep | |
import json | |
from pprint import pprint | |
import re | |
def find_phone_numbers(text: str) -> list[str]: | |
pattern = re.compile(r'\b\d{3}-\d{3}-\d{4}') | |
phone_numbers = re.findall(pattern, text) |