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

Author: Logan

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

Tower of Hanoi | Recursion using Mathematical Induction

The Tower of Hanoi is a mathematical puzzle (game) consisting of three rods and a number of disks.
The objective of the puzzle is to move all the disks from the first rod (A) to the next rod (B) using the auxiliary rod (C).

Backtracking & Recursion

Lucy and Flowers | HackerRank Solution [Medium]

The number of possible Binary Search Trees with n keys is Catalan Number (Cn). You could learn about Catalan Number & Binomial Coefficient.

Competitive Programming, Dynamic Programming, Mathematics

Program for Nth Catalan Number

Catalan numbers (Cn) are a sequence of natural numbers. Nth Catalan number has applications in many counting problems.

Competitive Programming, Dynamic Programming, Mathematics

How to calculate Binomial Coefficient (nCr) in O(r) time complexity

The recomputations in calculating binomial coefficient (nCr) can be avoided by exploiting optimal substructure and overlapping subproblems

Competitive Programming, Dynamic Programming, Mathematics

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

Palindrome Index | HackerRank Solution [Easy]

Given a string of lowercase letters in the range ascii[a-z], determine the index of a character that can be removed to make the string a palindrome

Competitive Programming, Greedy approach

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

PacMan – DFS | HackerRank Solution [Easy]

Print all the nodes that you encounter while printing DFS tree. Then, print the distance ‘D’ between the source ‘P’ and the destination ‘.’

Competitive Programming, Depth First Search (DFS)

Posts pagination

< 1 … 11 12 13 … 24 >
  • 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