Open In App

Contest Experiences | LeetCode: #Weekly Contest 328

About the Contest: LeetCode #Weekly Contest 328

This was a contest organized on the LeetCode platform on January 15th, 2023 (Sunday) and it consisted of 4 questions that were to be solved in a time frame of 90 minutes from 08:00 AM to 09:30 AM.

Prizes/Offers:

NOTE: LeetCode Coins are Special coins which can be redeemed in LeetCode store to buy available swags.



Link of the contest: https://leetcode.com/contest/weekly-contest-328/

Overview of the Challenge:

Problem Name

Points/Scores

Difficulty Level

Pre-Requisites

Time to Solve

Difference Between Element Sum and Digit Sum of an Array

3

Easy

Maths and arrays

2 min

Increment Submatrices by One

4

Medium

Matrix and Prefix Sum

15 min

Count the Number of Good Subarrays

5

Medium

HashMap and Sliding Window

25 min

Difference Between Maximum and Minimum Price Sum

6

Hard

DFS

unable to solve

Problem 1: Difference Between Element Sum and Digit Sum of an Array



It was a very simple question, where you need to simply traverse the array and get the sum of all the elements of the array and also get the sum of all the digits of all the elements of the array and finally return the absolute value of the difference between these two sums.

Problem 2: Increment Submatrices by One

Problem 3: Count the Number of Good Subarrays

It was a well designed and a good level question according to me, it took some amount of times and after getting some WA, it got accepted. I used a hashmap to store the count frequency of the elements occurring in the array and the used the sliding window concept to move the window whenever there is a good pairs after adding it to my answer. If the k value goes lesser than or equals to 0 , simply added it to answer and removed the count from the hashmap by moving forward pointer of the window.

Problem 4: Difference Between Maximum and Minimum Price Sum

Conclusion:

Article Tags :