Sum of List
Problem: Given a list of integers, return the sum of all elements.
Input:
nums= [1,2,3,4]
Output:
10
Find Maximum Element
Problem: Return the largest element in the list.
Input:
nums= [3,7,2,9,5]
Output:
9
Find Minimum Element
Problem: Return the smallest element in the list.
Input:
nums= [3,7,2,9,5]
Output:
2
Count Even Numbers
Problem: Count how many even numbers are present in the list.
Input:
nums= [1,2,4,7,8]
Output:
3
Reverse a List
Problem: Return the reversed list.
Input:
nums= [1,2,3]
Output:
[3,2,1]
Check Element Exists
Problem: Return true if target exists in list.
Input:
nums= [10,20,30]
target=20
Output:
true
Remove Duplicates
Problem: Return list with duplicates removed.