Skip to main content
9 events
when toggle format what by license comment
May 20 at 11:41 comment added Robert @EngineerP I added more explanation and an implementation now.
May 20 at 11:37 history edited Robert CC BY-SA 4.0
Added more explanation and an implementation
May 20 at 9:04 comment added EngineerP I have edited the description to include the link to it and the letters in the input string. I am considering only lowercase characters from 'a' to 'z'. I am just including a "for loop" within my "while loop" during the optimization and O(n * m) is the best I have been able to get to so far. O(n) would be ideal and it should reduce the running time to something less than 10 ms. I am still working on it.
May 20 at 8:26 comment added Robert @EngineerP Your new code didn't seem correct, as it assumed that the strings only contain letters 'a' to 'z', but the task description has no such restriction.
May 20 at 6:28 history edited Toby Speight CC BY-SA 4.0
Use italic for metavariables
May 20 at 1:04 comment added EngineerP Hey! I optimized the code. I took some online help to just understand the schematic (not the code) and put that into code. The optimized version takes approximately 135 ms while the former took approximately 808 ms. Could you please take a quick look and let me know if the optimized version is fine? Many thanks!
May 19 at 21:32 comment added EngineerP Thanks for the review! I will try to figure out the optimization.
May 19 at 21:32 vote accept EngineerP
May 19 at 21:14 history answered Robert CC BY-SA 4.0