CODING CHALLENGES

代码题库

用接近 LeetCode 的题表进入训练:先筛选题目,再进入双栏题面和编辑器。每道题只展示它实际声明支持的语言。

继续刷题

题目列表

显示 85 / 646 道可提交题。 当前筛选:标签:Time series,权限:免费

提交状态:未尝试未正确已正确
未尝试
coding-array-product-except-self可练习
除自身以外数组的乘积

Array Product Except Self

简单免费版Python / C++ / Rust
未尝试
coding-best-single-trade-in-a-day可练习
日内最优单次交易

Best Single Trade in a Day

简单免费版Python / C++ / Rust
未尝试
coding-best-trades-k-transactions-fee可练习
限次交易加固定手续费的最优收益

Best Trades With K Transactions and Fee

困难免费版Python / C++ / Rust
未尝试
coding-closer-stronger-bid-distance-bidirectional可练习
双向更强买价的最近距离:取前向 / 后向严格更高 print 中较近者

Closer-Stronger Bid Distance (Bidirectional): Min of Prev / Next Strictly-Higher Bid

中等免费版Python / C++ / Rust
未尝试
coding-closest-trade-pair-notional可练习
最接近目标名义本金的成交配对

Closest Trade Pair to Target Notional

中等免费版Python / C++ / Rust
未尝试
coding-count-in-band-k-windows可练习
全部报价位于容差带内的 K 期窗口计数

Count K-Tick Windows With Every Quote Inside the Tolerance Band

简单免费版Python / C++ / Rust
未尝试
coding-count-positive-flow-k-windows可练习
严格净流入的 K 期窗口计数

Count of Strictly-Positive Net-Inflow K-Period Windows

简单免费版Python / C++ / Rust
未尝试
coding-cumret-drawdown-flagged-indices可练习
累计 PnL 回撤告警:超过阈值的水下时刻下标

Cumulative PnL Drawdown Alert: Sorted Indices Underwater Beyond Threshold

中等免费版Python / C++ / Rust
未尝试
coding-cumret-zero-crossings可练习
累计 PnL 零交叉次数:回测净值曲线的符号翻转计数

Cumulative PnL Zero-Crossings: Count Sign Flips of the Backtest Equity Curve

中等免费版Python / C++ / Rust
未尝试
coding-cumulative-volume-snapshot可练习
累计成交量快照查询

Cumulative Volume Snapshot

简单免费版Python / C++ / Rust
未尝试
coding-cumulative-vwap-at-each-tick可练习
逐笔累计成交量加权均价

Cumulative VWAP at Each Tick

中等免费版Python / C++ / Rust
未尝试
coding-daily-pnl-streak-stack可练习
距下一个更高 P&L 的天数

Days Until a Better PnL

简单免费版Python / C++ / Rust
未尝试
coding-earliest-window-sum-and-floor可练习
同时满足累计收益达到目标且窗口内单期不破下限的最早 K 期窗口

Earliest K-Period Window Whose Cumulative Return Meets A Sum Target And Whose Worst Single Period Stays Above A Floor

中等免费版Python / C++ / Rust
未尝试
coding-earliest-window-variance-breach可练习
最早一段总体方差严格越过冲击阈值的 K 日窗口

Earliest K-Day Window Whose Population Variance Strictly Exceeds A Spike Threshold

中等免费版Python / C++ / Rust
未尝试
coding-ewma-volatility-forecast-riskmetrics可练习
RiskMetrics EWMA 波动率预测

RiskMetrics EWMA Volatility Forecast

中等免费版Python / C++ / Rust
未尝试
coding-find-pivot-index可练习
P&L 序列的枢轴下标

Find the Pivot Index of a P&L Stream

简单免费版Python / C++ / Rust
未尝试
coding-first-day-cumulative-pnl-crosses-threshold可练习
累计 PnL 首次突破阈值的交易日

First Day Cumulative PnL Crosses Threshold

简单免费版Python / C++ / Rust
未尝试
coding-highest-k-day-range可练习
K 日最大波动区间

Highest K-Day Range

中等免费版Python / C++ / Rust
未尝试
coding-k-day-momentum-hits可练习
K 日动量命中数

K-Day Momentum Hits

中等免费版Python / C++ / Rust
未尝试
coding-k-day-rolling-mean-filter可练习
K 日滚动均价滤波

K-Day Rolling Mean Filter

简单免费版Python / C++ / Rust
未尝试
coding-largest-volume-rectangle-histogram可练习
直方图中的最大体积矩形

Largest Volume Rectangle in a Histogram

中等免费版Python / C++ / Rust
未尝试
coding-longest-low-volume-window可练习
给定冲击预算下成交量序列的最长合规连续窗口

Longest Contiguous Window of Volumes Within an Impact Budget

中等免费版Python / C++ / Rust
未尝试
coding-longest-stable-trading-streak可练习
最长平稳交易区间

Longest Stable Trading Streak

中等免费版Python / C++ / Rust
未尝试
coding-longest-window-abs-return-budget可练习
绝对收益累加不超出波动预算的最长尾部连续窗口

Longest Trailing Window Whose Absolute-Return Sum Stays Within a Volatility Budget

中等免费版Python / C++ / Rust
未尝试
coding-match-bid-ask-snapshots可练习
撮合买卖盘快照时间戳

Match Bid and Ask Snapshots

简单免费版Python / C++ / Rust
未尝试
coding-max-profit-bounded-drawdown可练习
限定回撤下的最优持仓收益

Maximum Profit Over Bounded-Drawdown Window

困难免费版Python / C++ / Rust
未尝试
coding-max-sum-fixed-window-array可练习
定长滑动窗口最大和

Max Sum of Fixed-Size Window

简单免费版Python / C++ / Rust
未尝试
coding-maximum-concurrent-trades可练习
最大同时在仓交易数

Maximum Concurrent Trades

中等免费版Python / C++ / Rust
未尝试
coding-merge-k-sorted-trade-streams可练习
合并 K 条交易所成交磁带

Merge K Sorted Trade Streams

中等免费版Python / C++ / Rust
未尝试
coding-merge-two-trade-tapes可练习
合并两条成交磁带

Merge Two Trade Tapes

中等免费版Python / C++ / Rust
未尝试
coding-min-cancels-quote-stability可练习
最少撤单次数维持报价稳定

Min Cancels for Quote Stability

中等免费版Python / C++ / Rust
未尝试
coding-min-replenishments-to-avoid-stockout可练习
最少补货次数避免缺货

Min Replenishments to Avoid Stockout

困难免费版Python / C++ / Rust
未尝试
coding-min-stack-with-getmin可练习
支持 O(1) 取最小值的最小栈

Min-Stack with O(1) get_min

简单免费版Python / C++ / Rust
未尝试
coding-misra-gries-heavy-hitters可练习
Misra-Gries (k-1) 计数器在交易流上的重元素近似

Misra-Gries (k-1)-Counter Heavy-Hitters Over a Trade-Tape Stream

中等免费版Python / C++ / Rust
未尝试
coding-next-all-time-high-index可练习
距离下一次新高的索引:首个严格高于「累积最高水位」的未来 tick

Time-to-New-All-Time-High: First Future Index Strictly Above the Running Peak

中等免费版Python / C++ / Rust
未尝试
coding-next-bigger-bid-bounded-distance-ratio可练习
前向窗口内的下一次 depth-jump:在最佳买价深度 tape 上做受限距离比例阈值扫描

Next Depth-Jump within a Forward Window: Bounded-Distance Ratio-Threshold Scan over a Best-Bid-Depth Tape

困难免费版Python / C++ / Rust
未尝试
coding-next-greater-quote-time可练习
下一次更高报价的时间戳

Next Greater Quote Timestamp

简单免费版Python / C++ / Rust
未尝试
coding-next-smaller-element-mono-stack可练习
下一个更小元素的下标

Next Smaller Element Index

简单免费版Python / C++ / Rust
未尝试
coding-notional-by-venue-ranked可练习
按场所聚合的成交名义额排行榜

Notional by Venue, Ranked

中等免费版Python / C++ / Rust
未尝试
coding-online-autocorrelation-lag1可练习
时间序列的 lag-1 样本自相关系数

Lag-1 Sample Autocorrelation of a Time Series

简单免费版Python / C++ / Rust
未尝试
coding-online-cumulative-bollinger-bands可练习
在线累计 Bollinger 带:Welford 递推的带对序列

Online Cumulative Bollinger Bands: Welford-Recurrence Band-Pair Stream

中等免费版Python / C++ / Rust
未尝试
coding-online-ewma-covariance-pair可练习
在线 EWMA 配对协方差:跨资产对冲比建模基石

Online EWMA Covariance Pair — Cross-Asset Hedge-Ratio Building Block

中等免费版Python / C++ / Rust
未尝试
coding-online-ewma-residual-stream可练习
在线 EWMA 残差流:以"先前"指数加权均值衡量当期收益的意外度

Online EWMA Residual Stream — Surprise-vs-Prior Exponential-Weight Mean

中等免费版Python / C++ / Rust
未尝试
coding-online-ewma-variance可练习
在线 EWMA 方差:偏重近期的波动率追踪器

Online EWMA Variance — Recency-Weighted Volatility Tracker

中等免费版Python / C++ / Rust
未尝试
coding-online-mean-mad可练习
滚动均值与平均绝对偏差

Running Mean and Mean Absolute Deviation

简单免费版Python / C++ / Rust
未尝试
coding-online-median-slippage可练习
在线滑点中位数

Online Median of Slippage

中等免费版Python / C++ / Rust
未尝试
coding-online-running-excess-kurtosis可练习
在线运行超额峰度(Welford 四阶矩递推)

Online Running Excess Kurtosis via Welford-Style Fourth-Moment Recurrence

中等免费版Python / C++ / Rust
未尝试
coding-online-running-skewness可练习
在线运行样本偏度(Welford 三阶矩递推)

Online Running Sample Skewness via Welford-Style Third-Moment Recurrence

中等免费版Python / C++ / Rust
未尝试
coding-online-skewness-kurtosis可练习
在线流式计算均值、方差、偏度与超额峰度(Welford-Pebay)

Online Streaming Mean, Variance, Skewness, and Excess Kurtosis (Welford-Pebay)

中等免费版Python / C++ / Rust
未尝试
coding-online-zscore-outlier-flagger可练习
在线 Z 分数离群标记:用 Welford 累计历史检测 tick 流异常

Online Z-Score Outlier Flagger: Welford-Cumulative Anomaly Detection on a Tick Stream

中等免费版Python / C++ / Rust
未尝试
coding-optimal-cooldown-period-trades可练习
强制冷静期下的最优多次交易

Optimal Cooldown Period Trades

中等免费版Python / C++ / Rust
未尝试
coding-peak-inventory-day-after-batch-trades可练习
批量区间增量交易后的峰值库存日

Peak Inventory Day After Batched Range-Update Trades

简单免费版Python / C++ / Rust
未尝试
coding-prev-stronger-bid-distance可练习
上一次更强买价的距离:到最近一次严格更高买价 print 的间隔

Prev-Stronger Bid Distance: Time Since the Last Strictly-Higher Bid Print

中等免费版Python / C++ / Rust
未尝试
coding-range-sum-2d-prefix可练习
二维区间和查询(前缀和表)

2D Range Sum via Prefix Table

简单免费版Python / C++ / Rust
未尝试
coding-rank-strategies-by-sharpe可练习
按夏普比率排序策略(波动率作为次序)

Rank Strategies by Sharpe with Vol Tiebreak

中等免费版Python / C++ / Rust
未尝试
coding-recovery-distance-after-each-day可练习
前向恢复距离:累计增益重新越过阈值所需天数

Forward Recovery Distance: Days Until Cumulative Gain Clears Delta

中等免费版Python / C++ / Rust
未尝试
coding-removing-k-digits-monotonic可练习
删除 K 位数字 — 最小结果

Removing K Digits — Smallest Result

中等免费版Python / C++ / Rust
未尝试
coding-rolling-quote-stale-flags可练习
报价更新时间流上的"陈旧期后首次更新"标记

First-Update-After-Stale-Period Flags on a Quote-Update Timestamp Stream

中等免费版Python / C++ / Rust
未尝试
coding-rolling-trade-rate-window可练习
半开回看滑窗下的实时成交率计数

Live Trade-Rate Count over a Half-Open Lookback Sliding Window

中等免费版Python / C++ / Rust
未尝试
coding-rolling-vol-stable-window可练习
滚动样本波动率滑窗下的最长稳定波动率区间

Longest Stable-Volatility Regime via Rolling Sample-Stddev Sliding Window

中等免费版Python / C++ / Rust
未尝试
coding-rolling-window-range-spread可练习
双单调队列滑窗下的分钟级行情极差监控

Minute-Bar Range Monitor via Dual-Deque Sliding Max-Minus-Min

中等免费版Python / C++ / Rust
未尝试
coding-running-max-drawdown-stream可练习
流式对数收益 NAV 路径的运行最大回撤

Running Maximum Drawdown of a Streamed Log-Return NAV Path

中等免费版Python / C++ / Rust
未尝试
coding-running-min-max-deque可练习
数据流的累积最小最大值

Running Min and Max of a Stream

简单免费版Python / C++ / Rust
未尝试
coding-running-pearson-correlation-pair可练习
在线累计 Pearson 相关系数(Welford 共动差递推)

Running Cumulative-History Pearson Correlation via Welford-Style Co-Moment Recurrence

中等免费版Python / C++ / Rust
未尝试
coding-running-quantile-p2可练习
P-Square (P²) 流式分位数估计

P-Square (P²) Streaming Quantile Estimator

中等免费版Python / C++ / Rust
未尝试
coding-running-unbroken-bid-stack-sum可练习
仍未被击穿的买价栈累加和:当下尚未被覆盖的支撑层合计

Running Unbroken-Bid Stack Sum: Cumulative Support of Still-Standing Prior Bids

中等免费版Python / C++ / Rust
未尝试
coding-sector-day-return-rect-queries可练习
行业-交易日 收益方块:矩形区间求和的批量查询

Sector-Day Return Cube: Batched Rectangular Range Sums

中等免费版Python / C++ / Rust
未尝试
coding-shortest-window-abs-return-target可练习
绝对收益累加首次达到压力预算阈值的最短连续窗口

Shortest Contiguous Window Whose Absolute-Return Sum First Reaches a Stress-Budget Target

中等免费版Python / C++ / Rust
未尝试
coding-shortest-window-k-spikes可练习
收益流中包含 K 个幅度跳点的最短窗口

Shortest Window Containing K Magnitude Spikes in a Return Stream

中等免费版Python / C++ / Rust
未尝试
coding-sliding-window-max-quote可练习
报价滑动窗口最大值

Sliding Window Max of Quotes

中等免费版Python / C++ / Rust
未尝试
coding-span-of-higher-highs可练习
新高跨度(连续低价天数)

Span of Higher Highs

中等免费版Python / C++ / Rust
未尝试
coding-stock-span-monotonic-stack可练习
在线股价跨度

Online Stock Span

中等免费版Python / C++ / Rust
未尝试
coding-subarray-min-cost-fill可练习
订单簿全档位区间的均匀打穿股数总量

Total Uniform-Fill Shares across Every Order-Book Level Range

中等免费版Python / C++ / Rust
未尝试
coding-subarray-sum-equals-k可练习
和为 K 的子数组数

Subarray Sum Equals K

中等免费版Python / C++ / Rust
未尝试
coding-subranges-above-return-threshold可练习
累计收益超阈值的子区间计数

Subranges Above Return Threshold

中等免费版Python / C++ / Rust
未尝试
coding-sum-of-min-bid-depth-sweeps可练习
所有连续价位带扫荡的瓶颈深度合计:深度均匀度评分

Aggregate Bottleneck Bid-Depth across All Contiguous Price-Band Sweeps (Depth-Uniformity Score)

困难免费版Python / C++ / Rust
未尝试
coding-sum-subarray-mins-pnl可练习
P&L 子数组最小值之和

Sum of Subarray Minimum P&Ls

中等免费版Python / C++ / Rust
未尝试
coding-top-k-liquid-tickers可练习
流动性 Top-K 标的榜单

Top K Liquid Tickers

简单免费版Python / C++ / Rust
未尝试
coding-top-k-pnl-days-so-far可练习
实时 Top-K 盈利日榜单

Top K PnL Days So Far

中等免费版Python / C++ / Rust
未尝试
coding-trailing-high-watermark-span可练习
跟踪最高水位 span:每个 tick 的连续不超过当前价的回看长度

Trailing High-Watermark Span: Per-Tick Consolidation Length on a Synthetic Tape

中等免费版Python / C++ / Rust
未尝试
coding-trapping-volume-between-quotes可练习
局部高点报价之间的最大囤积体积

Trapping Volume Between Local-Max Quotes

中等免费版Python / C++ / Rust
未尝试
coding-unique-tickers-in-session可练习
盘中出现的唯一标的集合

Unique Tickers In Session

简单免费版Python / C++ / Rust
未尝试
coding-welford-warmup-trimmed-variance可练习
Welford 暖启动剪裁样本方差:仅在尾段稳定计算的在线估计量

Welford Warm-up-Trimmed Sample Variance — Stable Online Estimator on a Trailing Tail

中等免费版Python / C++ / Rust
未尝试
coding-window-argmin-offset可练习
滑窗最低价的窗内偏移:每段定长窗口内最低价相对左缘的位置

Sliding-Window Argmin Offset: Per-Window Position of the Minimum Price Relative to the Window Left Edge

中等免费版Python / C++ / Rust
未尝试
coding-windowed-positive-fraction可练习
定长滑窗内严格正收益占比

Rolling Hit-Rate of Strictly-Positive Returns over a Fixed-Size Window

中等免费版Python / C++ / Rust