Problem
This problem was asked by Nest.
Create a basic sentence checker that takes in a stream of characters and determines whether they form valid sentences. If a sentence is valid, the program should print it out.
We can consider a sentence valid if it conforms to the following rules:
The sentence must start with a capital letter, followed by a lowercase letter or a space.
All other characters must be lowercase letters, separators (
,
,;
,:
) or terminal marks (.
,?
,!
,‽
).There must be a single space between each word.
The sentence must end with a terminal mark immediately following a word.
Make sure you like this question on Substack. It really helps the newsletter grow. The solution to this problem will be shared tomorrow with the premium subscribers of the newsletter.
Consider filling out this survey. This helps me understand you better and will allow me to improve the content: Link: https://forms.gle/XfTXSjnC8W2wR9qT9
If you’re serious about getting good at coding/leetcode interviews, consider getting a premium subscription. It will let you get high-paying jobs at prestigious firms for less than 0.5 USD per day (only INR 800 or roughly 10 USD/month).
Not sure? Check out a sample solution here. You can expect such high-quality solutions every week when you subscribe. It also gives you access to an awesome community acing interviews all over the world. You could be missing an opportunity to supercharge your learning.
Was this question easy for you? Hard? Seen it somewhere before? Let me know in the comments below
Bonuses/Promotion (Get Free Stuff)
For most of my students, mock interviews have been very helpful. Enough mock interview practice is the key between getting that job offer and rejection. If you can get three people to become paying subscribers to this newsletter, you win a free mock interview. This offer has no upper limit, so the more subs you can get, the more mock interviews you win.
For one-time support of this newsletter. Any amount is appreciated and helps a lot. Supporting allows for exclusive benefits like annotated research papers, bonus discussions, and discounted rates for calls:
Venmo: https://account.venmo.com/u/FNU-Devansh
Paypal: paypal.me/ISeeThings
To share interesting problems/solutions with me, reach out to me. Different social media of mine also have other content from me. Good problems and/or solutions receive a free shoutout + 2 months of the paid newsletter:
Reach out to me on:
Instagram: https://www.instagram.com/iseethings404/
Message me on Twitter: https://twitter.com/Machine01776819
My LinkedIn: https://www.linkedin.com/in/devansh-devansh-516004168/
My content:
Read my articles: https://rb.gy/zn1aiu
My YouTube: https://rb.gy/88iwdd
Get a free stock on Robinhood. No risk to you, so not using the link is losing free money: https://join.robinhood.com/fnud75
good work!