LeetCode Daily Challenge-904. Fruit Into Baskets(Python, Med, O(n))
Sliding window+Hashmap, Optimal Python Solution | TC O(n) SC O(1)

Search for a command to run...
Articles tagged with #leetcode-medium
Sliding window+Hashmap, Optimal Python Solution | TC O(n) SC O(1)

Problem Description LeetCode 2044: Count Number of Maximum Bitwise-OR Subsets Given an integer array nums, we need to: Find the maximum possible bitwise OR of any subset of nums Return the count of different non-empty subsets that achieve this max...

Problem Description 1695. Maximum Erasure Value This problem asks us to find the maximum sum of a contiguous subarray where all elements are unique (no duplicates). We need to identify the subarray with unique elements that has the largest sum and ...

Two solutions: Sorting+Prefix Check vs Trie (Prefix Tree) TC: both O(n log n + n·m) SC: O(1) vs O(n·m)

Problem Statement LeetCode 560. Subarray Sum Equals K Given an integer array nums and an integer k, return the total number of continuous subarrays whose sum is equal to k. Example: Input: nums = [1,1,1], k = 2 Output: 2 (subarrays [1,1] at indice...

Find subsequence where (nums[i] + nums[i+1]) % k is the same for all pairs
