Open In App

Contest Experience : GeeksforGeeks Mega Job-A-Thon [05-07-23]

About Contest:

Coding problems:



There was total 3 coding problems, all of them based on DSA.

Overview Table:



Problem Name

Difficulty

Pre-requisite

Approx. time to solve

Number of Submissions

Magic and Toy shop

Easy

Greedy

5-8 mins

1

Count beautiful Strings

Medium-Hard

Hashing

20- 25 mins

3 (2 TLE)

Maximum good length

Medium

Binary Search ,Pre-sum

15- 20 mins

1

Question 1 : Magic and toy shop

Observations:

It was an easy problem in which we just have to think about in which index we have to perform the operation first to get most benefit , after some observation we can easily find out the greedy approach will work just fine.

Approach :

Result : Accepted!!

Question 2 : Count beautiful Strings

Observations:

This was a very good problem , Initially my thought was we can always select two strings having same odd characters and merge them it will create a string having all characters with even frequencies , but how should I find out that one odd occurring character ? after some thought I have the idea about:

Brute force Approach [TLE] :

Well I saw the problem and thought of a fairly easy brute force approach which was:

Obviously it will work but it will surely give us TLE because of constraints.

Optimized Approach :

Result: TLE … again !! But why ??

Reason: we are searching the vector again and again in the map which causes this problem … now how can we improve it ??

Improved Optimized Approach:

Result: Accepted!!

Question 3 : Maximum Good Length

Observations:

Because we have to tell the maximum size of L for which has atleast one L*L submatrix having minimum value >= L . And most of the maximum of minimum problems can be solved by Binary Search , So I applied it.

Approach :

Result: Accepted !!


Article Tags :