How do you find the second largest maximum of an unsorted array by linear scanning? How do you check if a number is a power of 2 in the smallest time in Python 3?
Represent array elements and numbers to check as SQL tables. Return the second-largest distinct non-null value for each array and a power-of-two result for every input number.
result_type, array_id, second_largest, number_value, is_power_of_twoarray_id, followed by number checks by number_value, with NULL last.| Column | Type | Description |
|---|---|---|
| element_idPK | INT | Unique element row identifier |
| array_id | INT | Identifier of the logical array |
| element_position | INT | Original position of the element |
| element_value | BIGINT | Numeric array element |
| Column | Type | Description |
|---|---|---|
| check_idPK | INT | Unique power-check identifier |
| number_value | BIGINT | Number to classify as a power of two |