Array Destructuring

Use array destructuring to extract the first and third elements into variables.
        
       Input:-"(apple,banana,cherry)"
       Input Description: Input: Array 
       Output: "(apple,cherry)"
       Output Description:  First and third elements as variables. 
       Constraints: 1 <= array length <= 1000
       Explanation: 

Loading...