|
-
July 15th, 2015, 11:16 AM
#6
Re: Find all sentences or consecutive sequence of sentences where min<=length<=max
Thanks for your lengthy explanation and breakdown. I was given the option to use C or C++. I have 9 years experience writing embedded software in C but very little C++. The reason for the mixing in my code is because I was using VisualStudio which only gave me an option for c++ templates as I don't have a regular C compiler on my computer at home. To clarify your points:
1- They say there is no fixed length for a line, but that min/max must be less than 1000, therefore I assume that any sentences (or sequence of sentences) in a line must also be less than 1000 chars.
2&3- explained above
4- i used cout to show some messages on the console when debugging but removed these lines before submitting the code, guess I forgot to remove the library header as well
5- my new solution uses a bit of pre-incr where it made sense to me, but I am more comfortable with post incr as it helps me keep track of the pointers in my head better
6- it didn't work, and only being given a short time to tackle the problem I dove right in before taking the time to understand what was being asked. It took me about 30mins re-reading the problem this morning to actually understand what is being asked.
I do have a working solution now that I did on my own. Well at least it works for all the examples that were given. I sent it in to the interviewer with an explanation of my misunderstanding. I doubt they will consider it, but I had to do it anyway for my own piece of mind.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|