❔ Only one testcase failed
I am stuck with this puzzle https://leetcode.com/problems/decode-string/submissions/
My code fails at this specific testcase as per screenshot.
Could anyone kindly point me in the right direction?
`
LeetCode
LeetCode - The World's Leading Online Programming Learning Platform
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
3 Replies
so, you're just supposed to be parsing that input commandbas a set of instructions for generating the output?
I very much like that I'm not seeing recusrion
I'm going to recommend you model the problem a little more
at the expense of having an "efficient" solution
which is really how you should do most development: implement sensibly first, then optimize where you can
so if we think about how to "model" this
your input consists of a string, that contains a set of instructions
write me a class that represents one of those instructions
or a set of classes, if that makes more sense
ended up doing it out of curiosity; took me longer than id like to admit. if this helps here is my approach and im able to explain any part you have questions about(also sorry Jaken I HAD to use recursion i am not thinking of a solution without one)
i feel you can do this with a stack though, as that was my initial thought, but i cant be arsed to think of the logic
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.