© 2026 Hashnode
Given an integer array nums containing distinct positive integers, find and return any number from the array that is neither the minimum nor the maximum value in the array, or -1 if there is no such number. Return the selected integer. Example 1: Inp...

Insertion sort is a simple comparison-based sorting algorithm that sorts by repeatedly inserting elements into their correct position. Let's explore how it works in detail. What is Insertion Sort? Insertion Sort is a comparison sort algorithm. It div...

Given an array arr[]. Your task is to find the minimum and maximum elements in the array. Examples: Input: arr[] = [1, 4, 3, -5, -4, 8, 6] Output: [-5, 8] Explanation: minimum and maximum elements of array are -5 and 8. Input: arr[] = [12, 3, 15, 7,...
