From 34bc22ec5477e785d080c93d72decb5c4d3ef38a Mon Sep 17 00:00:00 2001 From: Pralayesh Mukherjee <132552681+PralayeshMukherjee@users.noreply.github.com> Date: Sat, 18 Oct 2025 13:39:57 +0530 Subject: [PATCH] Implement solution for max consecutive ones problem --- 485. Max Consecutive Ones.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 485. Max Consecutive Ones.cpp diff --git a/485. Max Consecutive Ones.cpp b/485. Max Consecutive Ones.cpp new file mode 100644 index 0000000..2b77a15 --- /dev/null +++ b/485. Max Consecutive Ones.cpp @@ -0,0 +1,18 @@ +class Solution { +public: + int findMaxConsecutiveOnes(vector& nums) { + int max = 0; + int count = 0; + for(int i=0;i