diff --git a/leetcode/DIRECTORY.md b/leetcode/DIRECTORY.md index 1283f175..9ce6a443 100644 --- a/leetcode/DIRECTORY.md +++ b/leetcode/DIRECTORY.md @@ -16,6 +16,7 @@ | 11 | [Container With Most Water](https://leetcode.com/problems/container-with-most-water/) | [C](./src/11.c) | Medium | | 12 | [Integer to Roman](https://leetcode.com/problems/integer-to-roman) | [C](./src/12.c) | Medium | | 13 | [Roman to Integer](https://leetcode.com/problems/roman-to-integer/) | [C](./src/13.c) | Easy | +| 14 | [Max Consecutive Ones](https://leetcode.com/problems/max-consecutive-ones/) | [C](./src/14.c) | Easy | | 20 | [Valid Parentheses](https://leetcode.com/problems/valid-parentheses/) | [C](./src/20.c) | Easy | | 21 | [Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists/) | [C](./src/21.c) | Easy | | 24 | [Swap Nodes in Pairs](https://leetcode.com/problems/swap-nodes-in-pairs/) | [C](./src/24.c) | Medium | diff --git a/leetcode/src/14.c b/leetcode/src/14.c new file mode 100644 index 00000000..8f5a22d8 --- /dev/null +++ b/leetcode/src/14.c @@ -0,0 +1,25 @@ +int findMaxConsecutiveOnes(int* nums, int numsSize){ + int i=0; + int maxCount=0; + int count = 0; + + while(i