CtCI-6th-Edition-cpp
CtCI-6th-Edition-cpp copied to clipboard
Added a solution to q.12.1 - added a check to eliminate empty string which are pushed using getline
…k to eliminate empty strings Without this check it actually doesn't print the last k lines - (tested on Mac)
Much better version - building a vector of size K (in case K is much larger then the number of lines in file - it's much more efficient)
@KrishMunot Why have you approved and merged the PR containing many bugs? Especially the crash/undefined behavior by std::transform()
to the empty container?
My bad, feel free to revert it, i thought some of the commits were valid. Please revert it.
On Mon, Oct 17, 2022, 01:46 Sergey @.***> wrote:
@KrishMunot https://github.com/KrishMunot Why have you approved and merged the PR containing many bugs? Especially the crash/undefined behavior by std::transform() to the empty container https://github.com/careercup/CtCI-6th-Edition-cpp/pull/32#discussion_r961317756 ?
— Reply to this email directly, view it on GitHub https://github.com/careercup/CtCI-6th-Edition-cpp/pull/32#issuecomment-1280047955, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7YAUK7E54QMZYBN7RJPVDWDRPABANCNFSM4DCNVHDA . You are receiving this because you were mentioned.Message ID: @.***>
I can revert it, but it will require your approve, since I have no right to merge PRs.
Sure, no problem. I'll approve it.
On Mon, Oct 17, 2022, 11:43 Sergey @.***> wrote:
I can revert it, but it will require your approve, since I have not right to merge.
— Reply to this email directly, view it on GitHub https://github.com/careercup/CtCI-6th-Edition-cpp/pull/32#issuecomment-1280339776, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7YAUNMA7DAP23J4HTOHP3WDTU77ANCNFSM4DCNVHDA . You are receiving this because you were mentioned.Message ID: @.***>