Java Hyd Team
746 subscribers
986 photos
39 videos
670 files
690 links
https://teamhydteam.my.canva.site/

Can visit us on our website 😊
Still working on it 😊
Download Telegram
guys we are covering realtime project in this so personally I will say don't missout anything here
πŸ‘2
see the acceptance rate
No of submissions done to solve 1 question
seems to be small but biggest hurdle to solve
You are given an array nums of length n and a positive integer k.

A
subarray
of nums is called good if the absolute difference between its first and last element is exactly k, in other words, the subarray nums[i..j] is good if |nums[i] - nums[j]| == k.

Return the maximum sum of a good subarray of nums. If there are no good subarrays, return 0.



Example 1:

Input: nums = [1,2,3,4,5,6], k = 1
Output: 11
Explanation: The absolute difference between the first and last element must be 1 for a good subarray. All the good subarrays are: [1,2], [2,3], [3,4], [4,5], and [5,6]. The maximum subarray sum is 11 for the subarray [5,6].
Example 2:

Input: nums = [-1,3,2,4,5], k = 3
Output: 11
Explanation: The absolute difference between the first and last element must be 3 for a good subarray. All the good subarrays are: [-1,3,2], and [2,4,5]. The maximum subarray sum is 11 for the subarray [2,4,5].
Example 3:

Input: nums = [-1,-2,-3,-4], k = 2
Output: -6
Explanation: The absolute difference between the first and last element must be 2 for a good subarray. All the good subarrays are: [-1,-2,-3], and [-2,-3,-4]. The maximum subarray sum is -6 for the subarray [-1,-2,-3].


Constraints:

2 <= nums.length <= 105
-109 <= nums[i] <= 109
1 <= k <= 109

try solving this
long maxSum = Long.MIN_VALUE;for (int i = 0; i < nums.length; i++) {
long sum = 0; for (int j = i; j < nums.length; j++) {
sum += nums[j]; if (Math.abs(nums[i] - nums[j]) == k) {
maxSum = Math.max(maxSum, sum); }
}}
return (maxSum == Long.MIN_VALUE) ? 0 : maxSum;



// correct but you will get TLE here
public static long maximumSubarraySum(int[] nums, int k) { long maxSum = Long.MIN_VALUE;
for (int i = 0; i < nums.length; i++) { long sum = 0;
for (int j = i; j < nums.length; j++) { sum += nums[j];
if (Math.abs(nums[i] - nums[j]) == k) { maxSum = Math.max(maxSum, sum);
} }
} return (maxSum == Long.MIN_VALUE) ? 0 : maxSum;
}
too much time to execute this code
Do you guys want me to schedule one easy level coding test on leetcode tom?
Anonymous Poll
100%
YES
0%
NO
Some prizes will also be there if we get most participants
Java Hyd Team
https://docs.google.com/document/d/1nyA7afccGnX0m-jJ0YudsinKOoysh70haLCA1sphYVY/edit?usp=sharing
Will teach this content So be ready with the notes and keep doing code together
sorry for the delay in update
Timings are 7:00 pm to 9:00pm
Java Hyd Team
Do you guys want me to schedule one easy level coding test on leetcode tom?
Will take test tomorrow only easy level questions and 3 questions 60 minutes time
So be ready with core Java concepts and efficient logics
Get Ready for the 🦦Go & πŸ¦€Rust programming languages Developer BootCamp 2024!

πŸ—“οΈ Date: February 10, 2024 (Saturday)
⏰ Time: 9:30 AM - 1:00 PM
πŸ‘₯ Mode: In-Person Learning
🏒 Venue: Microsoft Building 3, Gachibowli.

πŸ”— Register Today: swecha.org/developer-bootcamps

🌟 What’s Happening?
Embark on a Go and Rust programming languages adventure! Whether you're a coding newbie or a seasoned developer, our BootCamp is here to turbocharge your Go/Rust skills.

πŸ‘©β€πŸ’» Before You Join:
Install Rust on your laptop πŸ‘‰ rustup.rs
Install Go on your laptop πŸ‘‰ https://go.dev/doc/install

πŸ€‘ It's Free! No fees, all fun.
πŸŽ“ Get Certified: Complete the BootCamp, grab your digital badge!
βš™οΈ Dive into Hands-on Coding: Bring your laptop, let's Go/Rust together.
πŸ•°οΈ Be Punctual: Doors open at 9:00 AM, don't miss the coding train.

πŸ“ Location:
Microsoft Office, Building 3, Gachibowli, Hyderabad.

πŸ—ΊοΈ Maps:
OpenStreetMaps: https://www.openstreetmap.org/way/543748702#map=19/17.42955/78.34086
Google Maps: https://maps.app.goo.gl/gLU2wFBBD8YQKHQX7
Just now I got free sorry couldn't took session today because of some medical emergency