Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ba2453e

Browse files
authored
Create Special Array I.java
1 parent f93fb78 commit ba2453e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Easy/Special Array I.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution {
2+
public boolean isArraySpecial(int[] nums) {
3+
for (int i = 1; i < nums.length; i++) {
4+
if (nums[i] % 2 == nums[i - 1] % 2) {
5+
return false;
6+
}
7+
}
8+
return true;
9+
}
10+
}

0 commit comments

Comments
 (0)