<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Prefix Product on Algorithm Solutions</title><link>https://algorithm.liangqin.ren/tags/prefix-product/</link><description>Recent content in Prefix Product on Algorithm Solutions</description><generator>Hugo -- gohugo.io</generator><lastBuildDate>Sun, 22 Nov 2026 14:02:21 -0600</lastBuildDate><atom:link href="https://algorithm.liangqin.ren/tags/prefix-product/index.xml" rel="self" type="application/rss+xml"/><item><title>1352. Product of the Last K Numbers</title><link>https://algorithm.liangqin.ren/leetcode/1352/</link><pubDate>Sun, 22 Nov 2026 14:02:21 -0600</pubDate><guid>https://algorithm.liangqin.ren/leetcode/1352/</guid><description>1. Description Maintain a stream of integers and support queries for the product of its last k elements.
Implement the ProductOfNumbers class:
ProductOfNumbers() Creates an empty stream. void add(int num) Appends num to the stream. int getProduct(int k) Returns the product of the last k elements. The stream always contains at least k elements when queried. Every contiguous sequence has a product that fits in a signed 32-bit integer.</description></item></channel></rss>