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?
2024 Presidential Election
2d
1768
Biden: “you cannot go to a 7-Eleven unless you have a slight Indian accent”
Tech Industry
Yesterday
1917
What is the appeal to NVIDIA?
Software Engineering Career
Yesterday
2950
28 terrorist worshipping idiots just got themselves fired and I've never been prouder to work at Google.
Layoffs
Yesterday
11707
Google CFO confirms "large-scale" layoffs today (Apr 17)
Tech Industry
4h
1281
Go woke, go broke: Google fires 28 employees involved in pro-Hamas protest
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