Programmers / Operation Based on Length
Problem
- Link
- Description
- Perform addition or multiplication based on the array length
- Type
- Simple Operation
Solution 1
| |
- Description
- Check the array length and then perform the operation
- Time Complexity
- O(1)
- Always performs the same operation
- Space Complexity
- O(1)
- Function parameters and local variables