Maximum Polygon Perimeter
You're given an array of positive integers nums of length n.
Your task is to find the largest possible perimeter of a polygon whose sides can be formed from elements in nums. If it's not possible to create a polygon, print -1.
A polygon is a closed plane figure with n(>=3) sides, and the longest side of a polygon must be smaller than the sum of its other sides.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)