Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Max Integer in Array

EasyPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Max Integer in Array. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

What is the max integer in an array?

Implement a function that returns the largest integer in a non-empty array. The function should inspect the array directly and return a single integer.

Function: def find_max_integer(nums):

Input: A non-empty list of integers. Output: The largest integer in the list.

Constraints

  • 1 <= nums.length <= 10^4
  • -10^9 <= nums[i] <= 10^9
  • The array is non-empty

Function Signature

def find_max_integer(nums):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output