Basically i had a phone interview. The interviewer told me there will be 2 questions and i should complete both in 30 minutes. I couldn't even complete the first question. To me it's an LC Hard but i feel like i missed something out. Basically i approached in an iterative way where for everything nested i push it to a stack then process it. Obviously didn't have time to finish it all. Someone on here told me this is a simple OOP question but I don't see how. What am I missing here? This is the question: We're going to build the beginnings of a markdown processor. Markdown is a markup language that allows you to easily create HTML. > > We ll provide some sample input and desired output. Dont worry too much about edge cases, but feel free to ask if you re unsure or think there s something we ought to consider. Part 1 A markdown processor is capable of handling a multitude of string to html tag formats. For now, we just want to focus on supporting <p/>, <br/>, <blockquote/>, and <del/> tags. Input: String input = "This is a paragraph with a soft\n" + "line break.\n\n" + "This is another paragraph that has\n" + "> Some text that\n" + "> is in a\n" + "> block quote.\n\n" + "This is another paragraph with a ~~strikethrough~~ word."; Expected Output: "<p>This is a paragraph with a soft<br />line break.</p> <p>This is another paragraph that has <br /> <blockquote>Some text that<br />is in a<br />block quote</blockquote> </p> <p>This is another paragraph with a <del>strikethrough</del> word.</p>" Note: It's not important to produce this specific output! We only care if the HTML is valid. */
That is definitely not LC hard. Just looks like replacing characters lol...
How do you do a nested one?
Using a stack?
Use of a stack. More like LC med or easy. Similar to parentheses bracket question. With tokenization and character replacements.
This โ๏ธ
I find them quite different. I don't usually deal with string replacement. So i went ahead with character processing and storing them in a string. How do you exactly solve this?
Definitely not LC hard.
i had this on onsite and solved with recursive function very quickly, got offer
How did you solve it? Can you share your solution logic?
nice bro sick tip didn't even drop tc smh
Was asked the same question this week. Itโs not a hard question but itโs time consuming. Ran out of time as well.
Sorry to be rude but perhaps your definition of leetcode hard and what their definition of hard are an order of magnitude different. GL on your recruiting.
Donโt listen to the haters , this question is confusing and very easy to over think
Got asked this as well. Interesting that at the end the interviewer said "don't worry about this question we're still calibrating it".
Does anyone have a solution to this?
lol that is not LC hard
The closest one i found is https://leetcode.com/problems/tag-validator/
It's also very similar to calculator which is also LC hard