© 2026 Hashnode
The Problem: Given an array of integers, nums and a target integer, the task is to find the indices of two numbers in nums that add up to target. We are to assume there's always one unique solution, and we can't use the same element twice. The order ...

The Problem: An array is give, but it is randomly rotated. Right to Left rotation. We have to find a specified element in the array and return its index. The main issue would be the required time complexity being O(logn). The Solution: Of course, we ...

The Problem: We are given an array prices, which stores the stock value for each day -represented by the indices. They expect us to return the maximum profit possible by buying stock on one day and selling it on another day. Buy must happen before Se...

Given Problem: We are to find two elements in the given array, such that they add up to a specified target number. Leetcode has stated that the array will have distinct elements and only have one solution. Solution Nested Loops class Solution { publi...

The Problem: Link to Problem Finding the minimum element in a sorted array that has been rotated. An array of length ‘n’ sorted in ascending order can be rotated between 1 and n times. The given examples; the array nums = [0,1,2,4,5,6,7] will change ...

The problem: return maximum product of elements from a subarray in the given array, Given: 1 <= nums.length <= 2 * 10<sup>4</sup> -10 <= nums[i] <= 10 The product of any subarray of nums is guaranteed to fit in a 32-bit integer. Solution: Nes...

We have to return the maximum sum of elements from a subarray belonging to the given array. Given an integer array nums, find the subarray with the largest sum, and return its sum. Nested Loops was the only solution that I got after half an hour of...
