from typing import List import unittest def bitwise_or_with_trailing_zero(ints: List[int]) -> bool: """ Determine if it's possible to select two or more elements from the list such that their bitwise OR has at least one trailing zero. Args: ints (List[int]): The input list of positive integers. Returns: bool: True if such a selection is possible, False otherwise. """ n = len(ints) for i in range(n): for j in range(i + 1, n): if (ints[i] | ints[j]) % 2 == 0: return True return False # Unit tests class TestBitwiseOrWithTrailingZero(unittest.TestCase): def test_example_1(self): self.assertTrue(bitwise_or_with_trailing_zero([1, 2, 3, 4, 5])) def test_example_2(self): self.assertTrue(bitwise_or_with_trailing_zero([2, 3, 8, 16])) def test_example_3(self): self.assertFalse(bitwise_or_with_trailing_zero([1, 2, 5, 7, 9])) def test_no_trailing_zero(self): self.assertFalse(bitwise_or_with_trailing_zero([1, 3, 5, 7, 9])) def test_all_even(self): self.assertTrue(bitwise_or_with_trailing_zero([2, 4, 6, 8, 10])) if __name__ == "__main__": unittest.main()