Skip to main content
added 30 characters in body
Source Link

Why not multiply each value by its least-significant bit (aka that number in modulo 2), so that even numbers are zero and odd numbers stay what they are, then use max() to return the largest number (which has to be odd because all the evens were multiplied by zero)

**Note, assuming no negative-numbers, if there are than just use max but strip all "0" from your array.

Why not multiply each value by its least-significant bit, so that even numbers are zero and odd numbers stay what they are, then use max() to return the largest number (which has to be odd because all the evens were multiplied by zero)

**Note, assuming no negative-numbers, if there are than just use max but strip all "0" from your array.

Why not multiply each value by its least-significant bit (aka that number in modulo 2), so that even numbers are zero and odd numbers stay what they are, then use max() to return the largest number (which has to be odd because all the evens were multiplied by zero)

**Note, assuming no negative-numbers, if there are than just use max but strip all "0" from your array.

Alternate phrasing for clarity
Source Link
200_success
  • 145.7k
  • 22
  • 191
  • 481

Why not multiply each value by itself in modulo 2 this wayits least-significant bit, so that even numbers are zero and odd numbers stay what they are, then use max() to return the largest number (which has to be odd because all the evens were multiplied by zero)

**Note, assuming no negative-numbers, if there are than just use max but strip all "0" from your array.

Why not multiply each value by itself in modulo 2 this way even numbers are zero and odd numbers stay what they are, then use max() to return the largest number (which has to be odd because all the evens were multiplied by zero)

**Note, assuming no negative-numbers, if there are than just use max but strip all "0" from your array.

Why not multiply each value by its least-significant bit, so that even numbers are zero and odd numbers stay what they are, then use max() to return the largest number (which has to be odd because all the evens were multiplied by zero)

**Note, assuming no negative-numbers, if there are than just use max but strip all "0" from your array.

Source Link

Why not multiply each value by itself in modulo 2 this way even numbers are zero and odd numbers stay what they are, then use max() to return the largest number (which has to be odd because all the evens were multiplied by zero)

**Note, assuming no negative-numbers, if there are than just use max but strip all "0" from your array.