Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Create a method that returns the last element of an array.

Easy

Problem Statement

Create a method that returns the last element of an array.

Sample Input

[10, 20, 30, 40, 50]

Sample Output

50

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
# Predefined array array = [10, 20, 30, 40, 50] # Your logic here
Log in or sign up to run or submit your code.Log inSign up
Input
[10, 20, 30, 40, 50]
Expected Output
50