Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
207 views

golang - Kth largest element in an array using quick select - time limit exceeded issue

I am trying to solve the following problem in leetcode. https://leetcode.com/problems/kth-largest-element-in-an-array/description Given an integer array \$nums\$ and an integer \$k\$, return the \$k^\...
Debanjan's user avatar
1 vote
2 answers
175 views

Improving my solution to the Quiz project from Gophercises in Golang

I'm new to Go and I completed the first challenge from Gophercises. Any feedback would be highly appreciated. There are some things that I am unsure of if they are made in an optimal way. Github repo ...
Anthony Gedeon's user avatar
4 votes
2 answers
142 views

Project Euler 67 | Maximum sum path II reading from file

I tried to solve the Problem Euler 67 with golang, because I started to study Go recently. This is my solution: ...
Zoey's user avatar
  • 141
2 votes
1 answer
229 views

Go pig Latin translator

I've been recently fooling around with Go(lang) and ended up doing a (very) simple pig Latin parser. I'm pretty sure this is not the best solution out there (no punctuation and only lowercase letters) ...
baduker's user avatar
  • 1,358
4 votes
2 answers
718 views

Computing Scrabble score in Golang

I think we all know the game of Scrabble and how popular it is as a simple programming challenge. Here's my attempt at computing a Scrabble score for a given word done in Go. I must admit, I'm fairly ...
baduker's user avatar
  • 1,358
5 votes
1 answer
250 views

Golang checks for equilateral, isosceles, or scalene triangle

For me, learning the basics of a new programming language is best done through some easy to intermediate challenges. Here's one that's rather well known and relatively simple - determine if a triangle ...
baduker's user avatar
  • 1,358
1 vote
1 answer
73 views

Simulating pod racing over a 2D map : am I implementing OOP in a GO-like fashion?

I'm learning Go and I wrote this for a programming challenge. It is working (building and running) but I feel the code is not what Go code should be. I used an OOP design. Is it correctly implemented ...
Poutrathor's user avatar
3 votes
0 answers
106 views

Writing Go object code that respects Go guidelines

I'm learning Go and I wrote this for a programming challenge. It is working (building and running) but I feel the code is not what Go code should be: Am I using the ...
Poutrathor's user avatar
0 votes
1 answer
332 views

Finding the longest Collatz sequence using Go, concurrently

I am working through this problem on project euler. Basic purpose of the code: ...
The Nightman's user avatar
5 votes
3 answers
375 views

Beginner solution to basic quiz exercise, a la Gophercises

I just started golang development about two weeks ago and recently finished the recommended introduction book. I'm now working my way through Gophercises - a sort of collection of exercises to ...
geostocker's user avatar
3 votes
1 answer
440 views

Cryptopals Challenge 1.6 Solution in Golang

This is my solution to challenge 1.6 from Matasano/NCC Cryptopals. Here is my repository so the code can be cloned/ran and the bitutils/futils code can also be looked at if necessary (I've created ...
tomatopeel's user avatar
3 votes
1 answer
399 views

Parallel brute-force solution for Project Euler 4 (Largest palindrome product)

The pe4Concurrent.go file given below is my first attempt at writing a concurrent programme, pe4.go is a non-concurrent implementation of the same algorithm for comparison purposes. The algorithm ...
R. Duke's user avatar
  • 133
2 votes
1 answer
52 views

Go version of Advent of Code, day 5 - Dealing with runes

I tried to solve the Advent of Code quiz for day 5 in Go, since my brute force algorithm wasn't efficient in Ruby. I solved the first part of the quiz with the following Go code. ...
sschmeck's user avatar
  • 486
2 votes
1 answer
288 views

Project Euler #1 in Go (counting multiples of 3 or 5 up to 1000)

I've been working on Project Euler, here was my solution for Problem #1. It gave me the proper answer, but it's egregiously slow. How can I implement this more efficiently? My math skills aren't top-...
Sienna's user avatar
  • 463
4 votes
0 answers
122 views

Project Euler #2 in Go

I just learned Go (yesterday in fact) and today I made this solution to Project Euler #2. The problem is to sum the even Fibonacci numbers. My program uses the matrix representation of the linear ...
hacatu's user avatar
  • 472

15 30 50 per page