DEV Community

Discussion on: Data Structures & Algorithms using Rust: Find Numbers with Even Number of Digits

Collapse
 
ssivakumar profile image
Sivakumar

Thanks Coding Carter for your feedback.

As per my understanding, the problem statement is to find an element in Array which is "Even" interms of number of digits. For ex: 342 is an Even number but in terms of number of digits it is not "Even".

Hope this explains.

Please feel free to share your feedback.

Collapse
 
sno2 profile image
Carter Snook

Yes, but couldn't you do i_cnt & 1 instead of i_cnt % 2 == 0?

Thread Thread
 
ssivakumar profile image
Sivakumar

Yes, that can be refactored as you suggested.