We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b318f74 + 5d4b96e commit f009056Copy full SHA for f009056
3101-3200/3151_special_array_i.rb
@@ -0,0 +1,5 @@
1
+# @param {Integer[]} nums
2
+# @return {Boolean}
3
+def is_array_special(nums)
4
+ nums.each_cons(2).all? { |a, b| ((a & 1) ^ (b & 1)) == 1 }
5
+end
0 commit comments