Skip to content

Only Code

Eat Code Sleep – repeat

  • 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
  • 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

Coin Change II – LeetCode Solution [Medium]

You are given an integer array coins representing coins and an integer amount. Return the number of combinations that make up that amount.

Arrays, Competitive Programming, Dynamic Programming

Coin Change – LeetCode Solution [Medium]

You are given an integer vector coins[n] representing coins of different denominations and an integer amount representing a total amount of money.

Arrays, Competitive Programming, Dynamic Programming

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

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 navigation

1 2 >
  • Algorithms
  • Arrays
  • Backtracking & Recursion
  • Breadth First Search (BFS)
  • C/C++
  • Competitive Programming
  • Databases
  • Depth First Search (DFS)
  • Divide and Conquer
  • Dynamic Programming
  • Graphs
  • Greedy approach
  • Hashmaps
  • Heaps
  • Interview Questions
  • Java
  • Linked Lists
  • Machine Learning
  • Mathematics
  • Networking
  • Python
  • Queues
  • Sorting
  • Special Data Structures
  • Stacks
  • Trees
  • Web Development
© 2023 Only Code.