Implement a function that organizes a given list of integers into levels of a binary tree, where each level is represented as a sorted list of integers. The function should use the input list and its size to construct multiple levels, with each level having twice the number of elements as the previous one, sorted in ascending order.
Functionality Requirements:
Implement the function binTreeSortedLevels(arr, n) that takes two parameters:
arr: a list of integers (0 ≤ len(arr) ≤ 10^6).
n: the number of integers in the list arr.
The function should return a list of lists, where each sublist represents a level in the binary tree and contains the sorted integers for that level.
Input/Output Requirements:
Input: A list of integers and an integer representing the size of the list.
Output: A list of lists (each sublist being sorted) that represent the levels of the binary tree.
Implementation:
Create a file named /app/solution.py.
Implement the provided function signature exactly as shown, ensuring to append sorted sublists for each level of the binary tree to the main list.
Each level should consist of 1, 2, 4, 8, ... elements, sorted in ascending order until all elements from the input list have been processed.
Example:
If the input list is [4, 2, 1, 3, 6, 5, 7, 8] with n = 8, the output should be:
python
[
[1, 2, 3, 4],
[5, 6, 7, 8]
]
Ensure that your implementation efficiently handles the sorting and respects the structure of a binary tree through appropriately sized levels.