← 返回 amazon 的题目列表Python Scene Problem
类型:online_judge
You are part of a data science project involving data processing tasks. Write a Python program to solve the following task: Given a two-dimensional list where each sublist contains multiple integers, compute the sum of squares for each sublist, returning a list where each element is the sum of squares of the corresponding sublist.
Input: A two-dimensional list, for example [[1, 2, 3], [4, 5], [6]]
Output: Return a list where each element is the sum of squares of the elements in the corresponding sublist, such as [14, 41, 36]
Requirements:
Do not use built-in functions like sum or similar.
Provide analysis for time complexity and space complexity.
Example
Input
[[1, 2, 3], [4, 5], [6]]