Tejaswi Bm wrote:Thanks for the reply.
AM able to achieve the expected output given the input..the only problem is how it can be optimized/how it can be further enhanced so that the runtime might reduce given a very long input string.
Tejaswi Bm wrote:Thanks Jeff!!
But i dont think my code is optimized and can handle really huge input string. I have used a HashMap to store the tokens, but i feel the same can be achieved with 'something else'. I am not aware of that 'something else'.
Tejaswi Bm wrote:I don't think my code is optimized and can handle really huge input string.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Tejaswi Bm wrote:But i dont think my code is optimized and can handle really huge input string. I have used a HashMap to store the tokens, but i feel the same can be achieved with 'something else'. I am not aware of that 'something else'. So if you could point me in right direction??
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Tejaswi Bm wrote:With the suggestions that i have got from the learned ones in this forum, i tried to alter the code
...
but am not happy with the results..I want an avg time of around 600 millis..please help:(
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
++ good adviceMy advice: Write down ALL the rules for your "replace" in English before you write another line of code.
B M Tejaswi wrote:Encoding pair is given as part of input string. Encoding pair is separated by "===" in the input string.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here