All Posts
Leetcode 1546: Maximum Number of Non-Overlapping Subarrays With Sum Equals Target
Given an integer array nums and an integer target, return the maximum number of non-empty, non-overlapping subarrays that sum up to the target.
Leetcode 1562: Find Latest Group of Size M
You are given a permutation of integers from 1 to n, where each integer represents a position in a binary string of size n that is initially filled with zeros. At each step, you will flip the bit at the position specified by the current element of the array. You are also given an integer m, and your task is to determine the latest step at which there exists a contiguous substring of exactly m ones in the binary string.
Leetcode 1577: Number of Ways Where Square of Number Is Equal to Product of Two Numbers
Given two integer arrays, nums1 and nums2, return the total number of valid triplets that can be formed under two conditions:
Type 1: A triplet (i, j, k) is valid if nums1[i]^2 == nums2[j] * nums2[k] where 0 <= i < nums1.length and 0 <= j < k < nums2.length. Type 2: A triplet (i, j, k) is valid if nums2[i]^2 == nums1[j] * nums1[k] where 0 <= i < nums2.length and 0 <= j < k < nums1.length.