Skip to content

Instantly share code, notes, and snippets.

@jayant91089
jayant91089 / leetcode-bloomberg.md
Last active June 18, 2026 16:46
Answers to leetcode questions tagged 'Bloomberg'

121 Best Time to Buy and Sell Stock

Say you have an array for which the ith element is the price of a given stock on day i.

If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit.

Example 1: Input: [7, 1, 5, 3, 6, 4] Output: 5

@zdeslav
zdeslav / ATLCPImplMT.hpp
Last active June 23, 2018 10:14
IConnectionPoint implementation with multithreading support for ATL projects. It marshals the client interfaces to the sender thread via GIT. Based on Microsoft KB article 280512
// This is a supplement to the Active Template Library 3.0.
// Copyright (C) 2000 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended for illustration.
#ifndef __CPIMPLMT_H__
#define __CPIMPLMT_H__
#include <atlcom.h>
@BillAtHRST
BillAtHRST / latency.txt
Created May 31, 2012 16:21 — forked from jboner/latency.txt
Latency numbers every programmer should know
"Magic" Numbers
Operation Time (us) Source
L1 cache reference 0.0005 2,3
Execute typical instruction 0.0010 2,3
Branch mispredict 0.0050 2,3
Propagation delay in fiber-optic cable, per meter 0.0050 5
L2 cache reference 0.0070 2,3
Mutex lock/unlock (uncontested) 0.0250 2,3
Decode FAST message 0.0500 5