Dec 1, 2025 · 2 min read · 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...
Join discussion
Nov 28, 2025 · 2 min read · QUESTION: Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct. Example 1: Input: nums = [1,2,3,1] Output: true Explanation: The element 1 occurs at the indices 0 a...
Join discussion
Nov 2, 2025 · 2 min read · You are given an array of integers arr[]. You have to reverse the given array. Note: Modify the array in place. Examples: Input: arr = [1, 4, 3, 2, 6, 5] Output: [5, 6, 2, 3, 4, 1] Explanation: The elements of the array are [1, 4, 3, 2, 6, 5]. After ...
Join discussion
Oct 20, 2025 · 2 min read · 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,...
Join discussion
Oct 11, 2025 · 3 min read · Given an integer n, return true if it is a power of four. Otherwise, return false. An integer n is a power of four, if there exists an integer x such that n == 4<sup>x</sup>. Example 1: Input: n = 16 Output: true Example 2: Input: n = 5 Output: fals...
Join discussion
Oct 10, 2025 · 3 min read · Given an integer n, return true if it is a power of three. Otherwise, return false. An integer n is a power of three, if there exists an integer x such that n == 3<sup>x</sup>. Example 1: Input: n = 27 Output: true Explanation: 27 = 33 Example 2: In...
Join discussion
Oct 7, 2025 · 3 min read · QUESTION: Given a non-negative integer x, return the square root of x rounded down to the nearest integer. The returned integer should be non-negative as well. You must not use any built-in exponent function or operator. For example, do not use pow(...
Join discussion
Jul 20, 2025 · 1 min read · I have started this Journey to master my understanding and excel in coding sessions and DSA interviews. My Goals:1. “Crack Google/Microsoft as an AI Engineer.”2. “Master Problem Solving.”3. “Building Logical Thinking like a Top 1% Engineer.” How I’m ...
Join discussion
Sep 10, 2024 · 5 min read · What is Programming? Programming is the process of giving a computer a set of instructions to perform specific tasks. Think of it like writing a recipe, but instead of ingredients and steps for cooking, you're writing code that tells the computer exa...
Join discussion