Welcome
LIST placeholder
Automated grading of homework assignments and tests
- fork this repository
- solve the task
- commit with proper message
Problems
List01
Create a list with the following values: 1, 2, 3, 4, 5 Return the List
Example 1:
Input:
Output: [1,2,3,4,5]
List02
Make a list of ‘n’ zeros. Return the List
Example 1:
Input: 4
Output: [0,0,0,0]
Example 2:
Input: 6
Output: [0,0,0,0,0,0]
Constraints:
- 1 <= length(list1) <= 10^5
List03
Make a list of n ones. Return the List
Example 1:
Input: 4
Output: [1,1,1,1]
Example 2:
Input: 6
Output: [1,1,1,1,1,1]
Constraints:
- 1 <= length(list1) <= 10^5
List04
Create a list ranging from 0 to n. Return the List
Example 1:
Input: 4
Output: [0,1,2,3]
Example 2:
Input: 6
Output: [0,1,2,3,4,5]
Constraints:
- 1 <= length(list1) <= 10^5
List05
Create a list ranging from K to N. Return the List
Example 1:
Input: 4, 10
Output: [4,5,6,7,8,9]
Example 2:
Input: 6, 20
Output: [6,7,8,9,10,11,12,13,14,15,16,17,18,19]
Constraints:
- 1 <= length(list1) <= 10^5
List06
Create a list ranging from K to N with a step of 2. Return the List
Example 1:
Input: 4, 10
Output: [4,6,8]
Example 2:
Input: 6, 20
Output: [6,8,10,12,14,16,18]
List07
Create a list ranging from M to N with a step of K. Return the List
Example 1:
Input: 4, 10, 2
Output: [4,6,8]
Example 2:
Input: 6, 20, 4
Output: [6,10,14,18]
Constraints:
List08
Create a list of n elements with even numbers. Return the List
Example 1:
Input: 4
Output: [0, 2]
Example 2:
Input: 6
Output: [0,2,4]
Constraints:
List09
Create a list of n elements with odd numbers. Return the List
Example 1:
Input: 4
Output: [1,3]
Example 2:
Input: 6
Output: [1,3,5]
Constraints:
- 1 <= length(list1) <= 10^5
List10
Create a list of n elements, even index values are string and odd index values are integers. Return the List
Example 1:
Input: 4
Output: [“0”,1,”2”,3]
Example 2:
Input: 6
Output: [“0”,1,”2”,3,”4”,5]
Constraints:
- 1 <= length(list1) <= 10^5
List11
Create a list of n elements, each element is power of 2. Return the List
Example 1:
Input: 4
Output: [0,1,4,9]
Example 2:
Input: 6
Output: [0,1,4,9,16,25]
Constraints:
- 1 <= length(list1) <= 10^5
List12
Construct a list of n elements, in descending order, each element being a power of 2. Return the List
Example 1:
Input: 4
Output: [16,9,4,1]
Example 2:
Input: 6
Output: [36,25,16,9,4,1]
Constraints:
- 1 <= length(list1) <= 10^5
Warning
- don’t copy other solutions or any solution
- don’t remove comments