You are not logged in. Please login at www.codechef.com 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 https://www.codechef.com/viewsolution/18809047

asked 14 Jun, 08:15

nayan21garg's gravatar image

3★nayan21garg
11
accept rate: 0%

edited 14 Jun, 08:20


Check the while loop in your find method

link

answered 14 Jun, 11:17

akamoha's gravatar image

3★akamoha
1264
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, 13:08) nayan21garg3★
toggle preview
Preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×688
×590
×179
×162
×15

question asked: 14 Jun, 08:15

question was seen: 158 times

last updated: 14 Jun, 13:08