Techgig code gladiator finals 2019

How much did u score

I scored 150 (1st 100, 2nd 50) but I didnā€™t used suffix trees/LCP array for 1st one, did this https://bit.ly/2ZMrXhV :zipper_mouth_face:

It passes all of the cases of 1st question really because it have comlexity of O(n^2).

the test cases of 1st question is weakā€¦my solution is brute force O(n2 log(n)) and it get 100ptsā€¦
Iā€™m with @abdullah768 all the time after the coding roundā€¦ he is too simple and down to earth person ā€¦really nice to meet himā€¦

1 Like

Bro can u tell me your approach for 1st question.

Hey bro tells me one thing the link which u mentioned above the code passes 100 marksā€¦really
bcz your code maps the substring in lexicographical order.
Is this in the question is mentioned that map the distinct substring in lexicographical order an then count the distinct char in each?

What was @abdullah768 's score ?

Can you share the que with me ?

By using MAP I store only distinct substrings (Since only 1 value exists corresponding to a Key)
I also merged the calculation of distinct characters in the substring generation part and the value part of MAP stores the count, eg: MAP[ā€œappleā€]=4
Also MAP stores the keys in lexicographical order.

No but is it mentioned to map the values in lexicographical order.

1 Like

Yes MAP<string,int> automatically does that; it stores the key-value pair in lexicographical order (Key).
MAP<int,int> stores items in ascending order of Key(s)
UNORDERED MAP/HASH MAP doesnā€™t.

are yaar ye to pata hai par us question me ye kaha tha kya ki sorted order me hi map karna hai.

@ssrivastava990 u have not yet shared ur experience of code gladiators finale experience ,i actually wanted to see what i missed :smile: (especially any goodies etc)
Thanks in advance man ā€¦!!!