Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!



 1777

⭐[MEGA.NZ]⭐ ❤️TEEN PACK LEAKS #18❤️ ( 3.3TB) 2024 V5

by PornLeak - Yesterday - 07:42 AM
This post is by a banned member (jekoa3432) - Unhide
jekoa3432  
Registered
28
Posts
0
Threads
fsdfafa sdfdf
This post is by a banned member (CAKIZYZ) - Unhide
CAKIZYZ  
Registered
48
Posts
0
Threads
ty
This post is by a banned member (notthereal) - Unhide
78
Posts
0
Threads
thanks
This post is by a banned member (Gentester_49) - Unhide
24
Posts
0
Threads
tnx
This post is by a banned member (YaAyr) - Unhide
YaAyr  
Registered
96
Posts
0
Threads

The
This post is by a banned member (jullesarne9) - Unhide
125
Posts
0
Threads
Thanks m8!
This post is by a banned member (cuminarid) - Unhide
cuminarid  
Registered
43
Posts
0
Threads
1 Year of service
class Solution {
    public int[] resultsArray(int[] nums, int k) {
        int n = nums.length;
        int[] ans = new int[n - k + 1];
        int cnt = 0; // Count of consecutive increasing numbers

        for (int i = 0; i < n - 1; i++) {
            // Check for increasing consecutive numbers
            if (nums[i + 1] == nums[i] + 1) {
                cnt++;
            } else {
                cnt = 0; // Reset count if not consecutive
            }

            // When we have enough elements to form a subarray of size k
            if (i - (k - 2) >= 0) {
                int idx = i - (k - 2); // Starting index of the subarray
                if (cnt >= k - 1) {
                    // Subarray meets the criteria
                    ans[idx] = nums[i + 1]; // Maximum element of the subarray
                } else {
                    // Subarray does not meet the criteria
                    ans[idx] = -1;
                }
            }
        }

        return ans;
    }
}
This post is by a banned member (leonilmessi) - Unhide
10
Posts
0
Threads
js
(Yesterday - 07:42 AM)PornLeak Wrote: Show More
js

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: mrsir6264, William3011, YaAyr, 53 Guest(s)