Skip to main content

Timeline for Filling a string at minimal cost

Current License: CC BY-SA 3.0

19 events
when toggle format what by license comment
Mar 21, 2018 at 18:16 vote accept CaptainTrunky
Mar 21, 2018 at 16:37 answer added juvian timeline score: 1
Mar 20, 2018 at 20:26 history tweeted twitter.com/StackCodeReview/status/976193356308058114
Mar 20, 2018 at 18:48 comment added juvian I see, will try to modify my solution
Mar 20, 2018 at 18:39 comment added CaptainTrunky @juvian Oops, sorry, the problem description is a bit misleading. You should print a given string filling all wildcards. So in your example expected output is cost_of_single_block + 5*cost_of_printing
Mar 20, 2018 at 18:37 history edited CaptainTrunky CC BY-SA 3.0
clarification
Mar 20, 2018 at 18:28 comment added juvian I don´t understand your expected values. For example XYZYX you don´t need any changes, so cost should be 0.
Mar 20, 2018 at 12:12 comment added CaptainTrunky Yes, you can use only these symbols. Max block size is the right idea, I think. Currently I'm investigating ways to build a string from left to right using dynamic programming using blocks of fixed sizes, it should boost performance a lot, but I still don't see right optimal structure of the problem.
Mar 19, 2018 at 20:47 comment added juvian Are the possible letters only X, Y and Z?
Mar 19, 2018 at 19:27 comment added juvian A possible optimization is to skip checking with big block sizes when its obvious it won´t have an answer. When you see Y*X*Z, you know that max block size would be 3, because you cant fit 4 or more there
Mar 19, 2018 at 18:07 comment added CaptainTrunky @juvian No, you should decide on a block_size before printing. You are not allowed to change it in the middle of printing.
Mar 19, 2018 at 16:37 comment added juvian Can you use different block sizes for a single string?
Mar 18, 2018 at 12:59 history edited Deduplicator CC BY-SA 3.0
marking the quote
Mar 17, 2018 at 20:13 history edited CaptainTrunky CC BY-SA 3.0
added 1 character in body
Mar 17, 2018 at 17:05 history edited CaptainTrunky CC BY-SA 3.0
minor code fix
S Mar 16, 2018 at 9:08 history suggested yuri CC BY-SA 3.0
Formatting
Mar 16, 2018 at 9:03 review Suggested edits
S Mar 16, 2018 at 9:08
Mar 16, 2018 at 7:45 review First posts
Mar 16, 2018 at 8:21
Mar 16, 2018 at 7:44 history asked CaptainTrunky CC BY-SA 3.0