Skip to content

Commit

Permalink
add sol
Browse files Browse the repository at this point in the history
  • Loading branch information
ductnn committed Feb 1, 2025
1 parent efbd8eb commit 0716645
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions leetcode/daily/3151/sol.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package main

import "fmt"

func isArraySpecial(nums []int) bool {
for i := 1; i < len(nums); i++ {
if nums[i] % 2 == nums[i-1] % 2 {
return false
}
}
return true
}

func main() {
nums := []int{2, 1, 4}
fmt.Println(isArraySpecial(nums))
}

0 comments on commit 0716645

Please sign in to comment.