MOBIKWIK Hiring | Largest Perimeter Triangle | On-Campus OA (2024)
Question · Posted Jun 2026
Problem Statement Given an integer array nums, return the largest possible perimeter of a triangle with a non-zero area that can be formed using three side lengths from the array. If it is impossible to form any valid triangle, return 0. Example Input nums = [2,1,2] Output 5 Explanation The sides (2, 1, 2) satisfy the triangle condition: 1 + 2 > 2 Perimeter: 2 + 1 + 2 = 5 Constraints 3 <= nums.length <= 10^4 1 <= nums[i] ...
The full answer & interview discussion are available to premium members.
Log in Create a free account