1295. Find Numbers with Even Number of Digits
🟩 Easy
Solution
My Solution
func findNumbers(nums []int) int {
sum := 0
for _, num := range nums {
if len(fmt.Sprintf("%d", num)) % 2 == 0 {
sum++
}
}
return sum
}

Leetcode: link
Previous1275. Find Winner on a Tic Tac Toe GameNext1299. Replace Elements with Greatest Element on Right Side
Last updated
Was this helpful?