Skip to content

Instantly share code, notes, and snippets.

View adamgarcia4's full-sized avatar

Adam Garcia adamgarcia4

  • Atlanta, Georgia
View GitHub Profile
// Write an application that tells us which ticker has a greater open price
const getExpensiveStock = async () => {
console.log("============ START ===========")
// Problem Decomposition
// 1. Define Names of Stocks to pull
const ticker1 = undefined
const formattedTicker1 = ticker1
const ticker2 = undefined
const formattedTicker2 = ticker2
const { restClient } = require("@polygon.io/client-js");
const rest = restClient("rt65BvAyd7yr219qQ7M9pHIe7qosYdwl");
const getOpenPrice = async (ticker) => {
if (ticker === 'GOOG') {
return 1000
}
if (ticker === 'AAPL') {
const swaggerValidationMiddleware =
(routeConfig: ISwaggerParams) => {
const AdditionalResponses: { [statusCode: string]: ResponseConfig } = {
422: {
description: 'Invalid input',
content: {
'application/json': {
schema: z.object({
code: z.string(),
message: z.string(),
D*F``n`@A`pc'BP>Sp>O9РM>|N ܚc( Q%VTD B$Q`ŸwӬ"%ڏ,",zJ#$QDU@ȈJΒ)4Xh,e ߿~dD!OHw=
?
"DMP b
buOP!>.(hHpmĮJD`Lt~P e1I>HA~N#LNW}Lu/vѻL͝-TѪ)S!3D"a.Әr=}р1U0@TW!MBGDz?BagЃEިI߫[-ΤD2^p +];AXCwEϢJuS?c oWy j 1\
;?YHD ᢸ##ŒBw=zLxE5u e"J%(TySO% d M d+&Z[5 zD
>q.tynzJ^[Vjc~M768صDʑ&Yr*ܨk2%#;ۿˈ&:ަ`X[ND
.ƞp@ף̹M^*d(T/6u\~!F߯mC\~/CG|(`DzVV&i&iD
ޞpDv]^2[ݧ֮٦x)ѣy|dFqDƇ%kcB .|'hQP' 3MmD1p ުH,B#Wp2\ iOҵ?PAQ $]e=Rֳ%D#9\zs֟vӟX4#2-FCH*Y=~JLQjdAQH
UNh f~p֒EDiV/@@>@܉zc^?29+]o-o3JpHvDV%~W8BrD&aʞ2f<Dx{\q۷Z^hrU,#!Tz~bwRrQ6d98T A8VD3 ΘА;j٩)V#)e.(
NjuEF,$Mo(G$偒=?DA lʌ,GF+=LҟҌuoΝ`l!r|uzK-خO 􇝇/HWv4DK:|-˅/'䝤7OZuDS̯hP?͙P墎'az<8 6 䁌KKʇDC2^2DF ֌ ^݀<{^pAr^YwUml|I<9Y\G>|xԞajHwR(A;DXiɞ韖nER!mbՇ4 ,quٸesӥKLt*!ݧ9>'WNZf/鬃w򵖎](D g@!9
{
"licenseKey":"552258f2-1f24-43f9-914a-de3c4ff21b88",
"devtools_port":9090,
"runtime":{
"arguments":"",
"version":"18.87.55.19",
"fallbackVersion":"",
"futureVersion":""
},
"platform":{
{
"licenseKey": "552258f2-1f24-43f9-914a-de3c4ff21b88",
"devtools_port": 9090,
"runtime": {
"arguments": "",
"version": "18.87.55.19",
"fallbackVersion": "",
"futureVersion": ""
},
"platform": {
{
"licenseKey": "552258f2-1f24-43f9-914a-de3c4ff21b88",
"devtools_port": 9090,
"runtime": {
"arguments": "",
"version": "18.87.55.19",
"fallbackVersion": "",
"futureVersion": ""
},
"platform": {
from collections import defaultdict
def getAdjList(numNodes, fromList, toList):
adjList = [[] for _ in range(numNodes + 1)]
for u, v in zip(fromList, toList):
adjList[u].append(v)
adjList[v].append(u)
return adjList
{
"licenseKey": "552258f2-1f24-43f9-914a-de3c4ff21b88",
"devtools_port": 9090,
"runtime": {
"arguments": "",
"version": "18.87.55.19",
"fallbackVersion": "",
"futureVersion": ""
},
"platform": {
class Solution:
# This function updates the lowLink of nodeNum.
def dfs(self, at, parent, bridges):
# Initialize current node
self.visited[at] = True
self.lowLink[at] = self.rankNum
self.ids[at] = self.rankNum
self.rankNum += 1