---
title: "Discussion on \"LeetCode Daily Challenge-904. Fruit Into Baskets(Python, Med, O(n))\" | Hashnode"
description: "Discussion on \"LeetCode Daily Challenge-904. Fruit Into Baskets(Python, Med, O(n))\". Sliding window+Hashmap, Optimal Python Solution | TC O(n) SC O(1)"
url: "https://hashnode.com/posts/leetcode-daily-challenge-904-fruit-into-baskets/689073f589600b92f0382571"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [LeetCode Daily Challenge-904. Fruit Into Baskets(Python, Med, O(n))](https://huanganni.hashnode.dev/leetcode-daily-challenge-904-fruit-into-baskets?utm_source=hashnode&utm_medium=feed)

Sliding window+Hashmap, Optimal Python Solution | TC O(n) SC O(1)

Aug 4, 2025 · 4 min read · huanganni.hashnode.dev  
Read the article

-   [#leetcode-solution](https://hashnode.com/tag/leetcode-solution)
-   [#leetcodedaily](https://hashnode.com/tag/leetcodedaily)
-   [#leetcode-medium](https://hashnode.com/tag/leetcode-medium)

## Written by

[Anni Huang](https://hashnode.com/@HuangAnni)

@HuangAnni · Singapore

  
[View profile](https://hashnode.com/@HuangAnni)

LLM Training Operation Specialist @ ByteDance | Ex-Master of IT in Business (AI track) at SMU

I’m Anni Huang, an AI researcher-in-training currently at ByteDance, specializing in LLM training operations with a coding focus. I bridge the gap between engineering execution and model performance, ensuring the quality, reliability, and timely delivery of large-scale training projects.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
