Questions tagged [algorithm]

For challenges related to creating or implementing an algorithm.

Filter by
Sorted by
Tagged with
36
votes
21answers
3k views

The Original Number

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 (...
26
votes
9answers
855 views

There's an echo in my array… echo in my array… my array

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 ...
23
votes
6answers
2k views

128 years? Hypothetical leap year reform

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: ...
22
votes
23answers
3k views

Upside-Down Pyramid Addition…REVERSED!

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 ...
16
votes
11answers
2k views

Ethiopian Multiplication

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 ...
12
votes
5answers
221 views

Matrix trace for any matrix through… Bresenham’s line rasterisation

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 ...
11
votes
8answers
675 views

Number Triangles

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 ...
10
votes
5answers
496 views

Consistent Overhead Byte Stuffing (COBS)

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 ...
8
votes
4answers
621 views

Find the rows which make each column have one True (was: Knuth's Algorithm X)

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 ...
7
votes
2answers
191 views

Create a version series

The Definition Given an integer x, a version series is a set of digits (base 10) from which any x-length subset of consecutive ...
3
votes
2answers
364 views

Golfing Newton's Method

I have the following code which I've written to emulate Newton's method for deriving the square root of a number: ...
3
votes
6answers
485 views

Golf Me A Bubble Sort [duplicate]

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 ...
3
votes
1answer
1k views

remove duplicates from array [closed]

You have given an array from which we need to remove duplicates. Rules: First or immediate duplicates gets removed first. Array contains natural numbers ...
3
votes
0answers
81 views

lexicographically sorted list of index [closed]

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 ...
1
vote
2answers
271 views

Describe a 2D Bitmap Using Filled Rectangle Mapping

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):...
-7
votes
0answers
108 views

Challenging you n-queen with AI algorithm [on hold]

This challenge is very simple.You have to write backjumping algoirthm for n-queens problem in your desired language .If you don't know backjumping algorithm ,see wikipedia.If you don't know n-queens ...