Skip to content

the answer of any-odd-one.c seems wrong #81

@Jammillk

Description

@Jammillk

I think the answer return !!(0xAAAAAAAA & x); is for "any-even-one"

for example, 4bit unsigned int 0101 & 0xA(1010) = 0000, after two !! the result is 0, it's incorrect.

if I change 0xAAAAAAAA to 0x55555555, 4bit unsigned int 0101 & 0xA(0101) = 1111, after two !!, the result is 1,it's correct.

it confuse me so long, please help me answer it ,thank u ~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions