You are not logged in. Please login at to post your questions!


SHKSTR problem in editorial

I have used almost the same approach as the online one. Instead of a vector, i just stored the first occurence of the alphabet and another field which told me the index of the first word which ends there. But, I am getting a TLE for it. Could you help me find why it is happening? The link to my solution

asked 14 Jun '18, 08:15

nayan21garg's gravatar image

accept rate: 0%

edited 14 Jun '18, 08:20

Check the while loop in your find method


answered 14 Jun '18, 11:17

akamoha's gravatar image

accept rate: 20%

I think it's alright because for every node there will exist an end having the same value as frstOcc in the subtree.

(14 Jun '18, 13:08) nayan21garg3★
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 14 Jun '18, 08:15

question was seen: 181 times

last updated: 14 Jun '18, 13:08