Skip to main content

Questions tagged [algorithm]

For challenges related to creating or implementing an algorithm.

Filter by
Sorted by
Tagged with
-4 votes
3 answers
255 views

Motto of the day (MOTD) or Today's Motto is a algorithm to generate a unique & dynamic motto for every day. Input of the date to calculate motto for could be in any reasonable format. The program ...
QOO-OOKALAN's user avatar
-5 votes
1 answer
235 views

The daily motto is a project by me, allowing unique and dynamic motto every day. Here, you’ll attempt to rewrite my code, making it code-golf style. The motto uses a specific algorithm, determining ...
user avatar
1 vote
2 answers
333 views

I am looking to create a brainfuck program that can print the text "Hello, World" when executed--but not just that (it's too easy), it should also print "dlroW ,olleH" when the ...
Jore's user avatar
  • 137
14 votes
4 answers
1k views

The arrangement algorithm I think I've determined the algorithm that Google Calendar uses to visually arrange day-long and longer events at the top of the "Week" view (you may have an ...
Nicola Sap's user avatar
  • 3,823
15 votes
10 answers
3k views

The Venetian election system was... complicated. The Great Council came together and put in an urn the ballots of all the councilors who were older than 30. The youngest councilor went to St Mark's ...
KeizerHarm's user avatar
  • 1,373
27 votes
52 answers
4k views

Description Given an unsorted array of integers, find the smallest positive integer that does not appear in the array. Your task is to write the shortest code possible to solve this problem. Input A ...
aitzazisstuffed's user avatar
12 votes
10 answers
1k views

Introduction Our goal is to efficiently find the maximum of a large amount of (redundant) data. We define the outer product of vectors \$A\$ and \$B\$ as a matrix containing the products of all ...
Sebastian's user avatar
  • 221
7 votes
2 answers
525 views

Given a list of N lists, each containing M positive integers, and a separate list of M positive integers (target values), return a list of N scalars (integers with a value of 0 or more) that ...
drmosley's user avatar
  • 757
21 votes
25 answers
3k views

Introduction You're making a robot that can navigate a set of books of varying heights. It can climb books and jump off books, but if the distance is too big it will stop to prevent damage. To figure ...
Ginger's user avatar
  • 6,108
1 vote
0 answers
100 views

Based on this game. Description : Based on Wikipedia's description. The 24 Game is an arithmetical card game in which the objective is to find a way to manipulate four integers so that the end result ...
MSS2001's user avatar
  • 339
14 votes
9 answers
527 views

Challenge Your goal is to find the furthest point on a graph (from a provided start node). Your code doesn't need to handle cycles in the graph properly, but it might pose a fun challenge. For this ...
Hack5's user avatar
  • 341
1 vote
1 answer
501 views

In an attempt to “liberate” their fellow birds, a group of highly intelligent hens are attempting to compromise the zoo’s security system. To get access to the zoo’s mainframe, the hens first need to ...
VJZ's user avatar
  • 499
10 votes
1 answer
700 views

Convert NFA to DFA as quickly as possible. Input Your input will be an NFA. In order to be able to test your code, it needs to be able to handle an NFA in the following format. This is taken ...
user avatar
9 votes
1 answer
305 views

The Monkey has swung home to find his tree all in pieces. He likes order and scoops up all his 'tree-parts' and sets them out in 3 groups. The Monkey's ...
leopardxpreload's user avatar
2 votes
0 answers
257 views

After seeing some impossibly short solutions in this SE, I began to wonder what code someone could come up with to build a pseudo-random number generator. Now given that I am new to programming, I ...
user91975's user avatar
19 votes
1 answer
1k views

The challenge How well can you gerrymander North Carolina into 13 voting districts? In this challenge, you use the following files to draw different maps for Republicans and Democrats. File 1: ...
Dustin G. Mixon's user avatar
37 votes
14 answers
21k views

Winner found It seems as if we have a winner! Unless anyone plans on contesting the world's current fastest Sudoku solver, user 53x15 wins with the staggeringly fast solver Tdoku. For anyone still ...
maxb's user avatar
  • 7,017
8 votes
6 answers
312 views

This challenge is based on a video in which Andrew Huang discusses unusual time signatures... https://www.youtube.com/watch?v=JQk-1IXRfew In it, he advises that you can understand time signatures by ...
AJFaraday's user avatar
  • 11.8k
17 votes
3 answers
611 views

Given a black and white image with a white background and a set of black dots, paint a set of white pixels red, such that there is a path between each pair of black pixels. Details A path is a set ...
flawr's user avatar
  • 44.1k
37 votes
11 answers
2k views

Help! I seem to have an annoying echo in some of my arrays, and I'd like to get rid of it. When this occurs, the original array repeats itself somewhere in the middle causing the values to be added ...
640KB's user avatar
  • 12.4k
23 votes
23 answers
4k views

Upside-Down Pyramid Addition is the process of taking a list of numbers and consecutively adding them together until you reach one number. When given the numbers ...
Whimpers's user avatar
  • 355
10 votes
6 answers
2k views

I'm surprised this hasn't been posted before! The Consistent Overhead Byte Stuffing (COBS) algorithm is used to delimit byte streams. We choose a frame marker (we'll use 0x00) and wherever 0x00 ...
Patrick's user avatar
  • 351
1 vote
2 answers
348 views

Idea: Consider a 2-bit bitmap of arbitrary side-lengths overlaid on a coordinate grid and imaged with random data (1's represent an element of the image, 0's represent the "blank" canvas background):...
BenjaminF's user avatar
  • 113
14 votes
5 answers
460 views

Inspired by this. Agatha Stephendale, a sophomore who is really into raster graphics, has taken a course in linear algebra. Now she imagines matrices as rectangles, but in her artistic mind, she ...
Andreï V. Kostyrka's user avatar
3 votes
0 answers
110 views

Given a drawing of the letter shoot system, where an existing piece of pipe is marked with a *, and an empty spot is marked with a ., your task is to compile a lexicographically sorted list of index ...
Mat's user avatar
  • 39
23 votes
6 answers
2k views

The solar year is 365 days, 5 hours, 48 minutes, 45 seconds, and 138 milliseconds, according to this video. With the current Gregorian calendar, the rules for leap years are as follows: ...
Sherlock9's user avatar
  • 12.4k
3 votes
2 answers
511 views

I have the following code which I've written to emulate Newton's method for deriving the square root of a number: ...
Eliseo D'Annunzio's user avatar
20 votes
12 answers
4k views

This question is inspired by this answer. Coincidentally, I used to use Ethiopian Multiplication when I was a kid, but had never known the name of the method until recently. Ethiopian multiplication ...
Eliseo D'Annunzio's user avatar
3 votes
1 answer
1k views

You have given an array from which we need to remove duplicates. Rules: First or immediate duplicates gets removed first. Array contains natural numbers ...
Satish Patel's user avatar
37 votes
21 answers
4k views

Guidelines Scenario John has an important number, and he doesn't want others to see it. He decided to encrypt the number, using the following steps: His number is always a non-decreasing sequence (ie. ...
aimorris's user avatar
  • 1,431
4 votes
6 answers
726 views

Your task is to create a program that performs a bubble sort on a given array until it is sorted. Algorithm In order to qualify as a bubble sort, the program must operate as follows: Each pass goes ...
ckjbgames's user avatar
  • 1,339
7 votes
2 answers
292 views

The Definition Given an integer x, a version series is a set of digits (base 10) from which any x-length subset of consecutive ...
Addison Crump's user avatar
8 votes
4 answers
780 views

Task Given a Boolean matrix, find one (or optionally more) subset(s) of rows which have exactly one True in each column. You may use any algorithm, but must support very large matrices, like the last ...
Adám's user avatar
  • 31.8k
11 votes
8 answers
823 views

Credit My thanks to Rand Al'Thor's letter-based question for the inspiration for this code-golf challenge. Background The nature of this challenge is based off the algorithm mentioned by Rand in ...
Eliseo D'Annunzio's user avatar
0 votes
1 answer
404 views

At Hackerrank.com, the love letter mystery is a simple programming problem, which I already solved. My solution involved calculating the palindrome and counting the number of operations to do it. On ...
dornad's user avatar
  • 139