Skip to content

Only Code

Eat Code Sleep – repeat

  • Github
  • Home
  • Arrays
  • Linked Lists
  • Trees
  • Stacks
  • Queues
  • Heaps
  • Graphs
  • Algorithms+
    • Sorting
    • Dynamic Programming
    • Divide and Conquer
    • Backtracking & Recursion
    • Greedy approach
    • Breadth First Search (BFS)
    • Depth First Search (DFS)

Only Code

Eat Code Sleep – repeat

Close menu
  • Github
  • Home
  • Arrays
  • Linked Lists
  • Trees
  • Stacks
  • Queues
  • Heaps
  • Graphs
  • Algorithms+
    • Sorting
    • Dynamic Programming
    • Divide and Conquer
    • Backtracking & Recursion
    • Greedy approach
    • Breadth First Search (BFS)
    • Depth First Search (DFS)

Only Code

Eat Code Sleep – repeat

Search Toggle menu

Category: Arrays

Minimum Moves to Equal Array Elements – LeetCode Solution [Medium]

When we increment n – 1 elements, the relative difference between the highest number and all other numbers effectively decreases by 1.

Arrays, Competitive Programming, Mathematics

Minimum adjacent swaps required to sort Binary Array in O(n) | Amazon Interview Question

Given an array consisting of only 1s and 0s, sort this binary array such that all 0s are on the left and all 1s are on the right.

Arrays, Greedy approach, Interview Questions

Array Manipulation | HackerRank Solution [Hard]

Starting with a 1-indexed array of zeros and a list of operations, for each operation add a value to each the array element between two given indices, inclusive. Once all operations have been performed, return the maximum value in the array.

Arrays, Competitive Programming, Sorting

Sherlock and MiniMax | HackerRank Solution [Hard]

Given an integer range, for all M in that inclusive range, determine the minimum – abs(arr[i]-M) for all i

Arrays, Competitive Programming, Mathematics

Sherlock and Array | HackerRank Solution [Easy]

Challenge is to find an element of the array such that the sum of all elements to the left is equal to the sum of all elements to the right

Arrays

Max Min | HackerRank Solution [Medium]

Given a list of integers, arr, and a single integer k. Create an array of size k from elements of arr such that its unfairness is minimum

Arrays

Count of Maximum Solution

Given an array A of length N, your task is to find the element which repeats in A maximum number of times as well as the corresponding count.

Arrays, Competitive Programming, Hashmaps

Jump game – LeetCode Solution [Medium]

You are given an integer array nums. You are initially positioned at the array’s first index, and each element in the array represents your maximum jump length at that position.

Arrays, Competitive Programming

Find maximum of all subarrays of size k

Given an array of size n and an integer k, we need to find the maximum for each contiguous subarray of size k.

Arrays, Competitive Programming, Interview Questions

Best Time to Buy and Sell Stock [Interview Question]

You are given an array prices where prices[i] is the price of a given stock on the ith day. Return the maximum profit you can achieve from this transaction. If you cannot achieve any profit, return 0.

Arrays, Interview Questions

Posts pagination

< 1 2 3 >
  • Algorithms
  • Arrays
  • Backtracking & Recursion
  • Breadth First Search (BFS)
  • C/C++
  • Competitive Programming
  • Computer Science
  • Data Science
  • Databases
  • Depth First Search (DFS)
  • Divide and Conquer
  • Dynamic Programming
  • Graphs
  • Greedy approach
  • Hashmaps
  • Heaps
  • Interview Questions
  • Java
  • Linked Lists
  • Machine Coding Questions
  • Machine Learning
  • Mathematics
  • Networking
  • Programming Projects
  • Python
  • Queues
  • Sorting
  • Special Data Structures
  • Stacks
  • Trees
  • Web Development
© 2025 Only Code | Aureolls
Exit mobile version