haoel / leetcode

LeetCode Problems' Solutions
17.63k stars 4.92k forks source link

Add one more simple check to speed up the ZigZag Conversion. #13

Closed ghost closed 10 years ago

ghost commented 10 years ago

https://github.com/haoel/leetcode/blob/4cda31053dcd42e01fb1bb87cf9f09de55f546e8/src/zigZagConversion/zigZagConversion.cpp#L31

if (nRows >= s.length()) return s;
haoel commented 10 years ago

This is a very good finding, I will fix it in my code soon.

Thanks a lot!