• Skip to main content
  • Skip to footer

Ghoper logic

Algoritmos y lógica con Golang

  • Fácil
  • Intermedio
  • Avanzado
  • Todos
  • GitHub

Prefix Sums

Sum Between Range

Easy

Given an integer array, write a function which returns the sum of values between two indexes.

Example:

Input: nums = [3, -7, 6, 0, -2, 5],
       [sum_range(0, 3), sum_range(2, 4), sum_range(2, 2)]
Output: [2, 4, 6]

Constraints:

  • nums contains at least one element.
  • Each sum_range operation will query a valid range of the input array.

K-Sum Subarrays

Medium

Find the number of subarrays in an integer array that sum to k.

Example:

Input: nums = [1, 2, -1, 1, 2], k = 3
Output: 3

Product Array Without Current Element

Medium

Given an array of integers, return an array res so that res[i] is equal to the product of all the elements of the input array except nums[i] itself.

Example:

Input: nums = [2, 3, 1, 4, 5]
Output: [60, 40, 120, 30, 24]

Explanation: The output value at index 0 is the product of all numbers except nums[0] (3⋅1⋅4⋅5 = 60). The same logic applies to the rest of the output.

Footer

Primeros con algoritmia

Algoritmo de Floyd

Algoritmos por dificultad en Go

  • Fácil
  • Intermedio
  • Avanzado
  • Todos
  • GitHub

Cada sábado estudio y juego con un algoritmo, y se me ocurrió compartir las notas notas para me obligarme a escribir mejor y así  empece a escribir en 2021.

Ahora puedes resolverlos con IA, pero lo hago por curiosidad!

Algoritmos fáciles con Go

  • Algoritmo de Floyd
  • In-Place
  • Amazon Interview | Asteroid Collision | Data Structures & Algorithms
  • Cifrado César
  • Básicas
  • Más usadas
  • Complejas

Algoritmos intemedios con Go

  • Algoritmo de Floyd
  • In-Place

Algoritmos avanzados con Go

  • Algoritmo de Floyd
  • In-Place

Copyright © 2026 · Log in