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

Programming Exercises

Check if an array contains a specific value

Easy

Problem Statement

Check if an array contains a specific value

Sample Input

[1, 2, 3, 4, 5], value = 3

Sample Output

The array contains 3

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
fun main() { val numbers = arrayOf(1, 2, 3, 4, 5) val valueToCheck = 3 // Add your code here to check if the array contains the value }
Log in or sign up to run or submit your code.Log inSign up
Input
[1, 2, 3, 4, 5], value = 3
Expected Output
The array contains 3