LeetCode-485. Max Consecutive Ones
Description:
Example 1:
Note:
Sloution(C++):
算法分析:
Easy题,不多说,熟能生巧,就是有一些细节要注意到,比如说,这种类似“丈量”遍历的办法,就是一个大循环,里面有自己的小循环,要注意小循环的条件问题,我写的时候还是错了的。然后小循环结束,需要重置cur的值。最后返回的是最大值mx,而非cur。
程序分析:
略。
//=====================BY zy2317878=====================//
//===================博观约取,厚积薄发===================////=========================END=========================//