Skip to content

Commit

Permalink
Create 3151. Special Array I (#703)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chayandas07 authored Feb 1, 2025
2 parents db32ccd + b543e1c commit 858ce27
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions 3151. Special Array I
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class Solution {
public:
bool isArraySpecial(vector<int>& nums) {
for(int i = 0; i < nums.size() - 1; i++) {
if (nums[i] % 2 == nums[i + 1] % 2) {
return false;
}
}
return true;
}
};

0 comments on commit 858ce27

Please sign in to comment.