Open In App

Contest experience [ Leetcode Weekly Contest 356 ]

About Contest:

Coding problems:

Overview Table:



Problem Name

Difficulty

Points

Approx. time taken by me

Number of Submissions

  • Number of Employees Who Met the Target

Easy

3

1-2 mins

1

  • Count Complete Subarrays in an Array

Easy

4

2-5 mins

1

  • Shortest String That Contains Three Strings

Medium

4

5 – 50 mins

3 (2WA)

  • Count Stepping Numbers in Range

Hard

6

Question 1: Number of Employees Who Met the Target

It was a pretty straightforward and easy question, just count the number of elements that are greater than or equal to the target, this count will be our answer.

Result: Accepted!!



Question 2: Count Complete Subarrays in an Array

Although the question tag was medium but I think because of the constraints it becomes an easy one. We just have to iterate for every subarray and count the number of distinct elements in that particular subarray, if it is equal to distinct elements in the whole array we increase our count.

Result: Accepted!!

Question 3: Shortest String That Contains Three Strings

I have given three strings a, b, and c and I have to find out the minimum length string which contains all three strings as a substring, now I have to join these three strings in such a way that all a, b, and c present in it and length is minimum so I thought I can make six permutations using these three strings. when we join two strings just check whether one string is already present in another string or how much of the prefix part of the second string is present in the suffix part of the first string and combine them optimally. doing this for all 6 permutations will give me my optimal smallest length desired string.

Result: Accepted !! after 2 (WA).

Question 4: Count Stepping Numbers in Range

This was the question I thought can be solved using the digit DP:

Result: Not Solved.

Conclusion:

In the end, I got a total [ 11/17 ] points and secured a rank of 2523 out of 26096 participants. I will try my best to solve the 4th question in the upcoming weekly contest 🙂

Article Tags :