Maximum Array Value
Updated
Problem statement
Given a non-empty array of integers nums, return the largest value in the array.
Function
maximumValue(nums: int[]) → intExamples
Example 1
nums = [3,-2,7,4]return = 7The largest value is 7.
Example 2
nums = [-8,-3,-11]return = -3All values are negative, and -3 is the largest.
Constraints
1 <= nums.length <= 100000-1000000000 <= nums[i] <= 1000000000
More Sierra interview questions
Similar questions at other companies
- Closest NumbersHeadlands Technologies · OAHeadlands Technologies interview questions
- Count Numbers Not Equal to the First TwoAirbnb · OAAirbnb interview questions
- REST API: Country CodesHackerRank · OAHackerRank interview questions
- Macaron Order with Set DiscountsShopify · OAShopify interview questions
- Build the Task HierarchyPendo · OA
- Lowest Number in an Open RangeCapital One · OACapital One interview questions
- Missing IntervalsIBM · OAIBM interview questions
- Total Cost Against the Lowest Earlier PricePayPal · OAPayPal interview questions
- Count User Mentions in Chat MessagesRamp · OARamp interview questions
- Count Valid Square PairsAuxoAI · OA