zhedahht / CodingInterviewChinese2

《剑指Offer:名企面试官精讲典型编程面试题》第二版源代码
Other
5.32k stars 2.17k forks source link

Interview question 12: function "hasPathCore" judge row and col's range? #43

Open LiuLei95 opened 5 years ago

LiuLei95 commented 5 years ago

In the funciton "hasPath" is limited row from 0 to rows and col from 0 to cols (line 43 and 45), but why in function "hasPathCore" still judge "row >= 0 && row < rows && col >= 0 && col < cols" (line 67)?