Linked Questions

3 votes
2 answers

Create an auto-cucumber program [duplicate]

Oops, Auto-correct. You have a word. But it's wrong. You wonder what word it would be. Thankfully, being a code golfer, You can make a code to take a rough guess. I/O You will be given a (wrong, ...
Matthew Roh's user avatar
  • 5,337
59 votes
18 answers

There are two new sheriffs in town – Identifying DJMcMego pairs!

We have some new sheriffs moderators in town, Mego and DJMcMayhem. We need a challenge to properly honour them for their new positions, so there we go. Here's something that has caught my attention ...
Mr. Xcoder's user avatar
  • 42.4k
25 votes
14 answers

Reuse your code!

In this challenge we try to solve two important problems at once. They are: Given integers \$a\$ and \$b\$, tell if \$a^b-1\$ is a prime number. Given integers \$a\$ and \$b\$, return \$a\choose b\$. ...
fergusq's user avatar
  • 5,117
19 votes
6 answers

I don't like change!

Input: Two strings without newlines or whitespaces. Output: Both input strings on separate lines, with spaces where necessary† for one of the two strings. And a third line with the characters ...
Kevin Cruijssen's user avatar
12 votes
6 answers

Levenshtein Your Source

The Levenshtein edit distance between two strings is the minimum possible number of insertions, deletions, or substitutions to convert one word into another word. In this case, each insertion, ...
Stephen's user avatar
  • 13.8k
8 votes
5 answers

I misspelled my domayn name

According to Alexa rankings, the top 10 websites are: ...
Daniel M.'s user avatar
  • 3,927
22 votes
2 answers

Each step of the Levenshtein distance

In this challenge you will write a program that takes two newline-separated strings, s1 (the first line) and s2 (the second line), as input (STDIN or closest). You can assume that the length of s1 ...
xenia's user avatar
  • 8,112
9 votes
5 answers

Edit distance where a substitution only costs the first time

This challenge is about the following variant of edit distance. Say we have a cost of 1 for inserts, deletes and substitutions as usual with one exception. A substitution for a given letter ...
user avatar
9 votes
5 answers

Find the closest swap

Take as input two strings \$A\$ and \$B\$. Output a string \$C\$ that is \$A\$ but with two characters swapped such that the Levenshtein distance \$d(C,B)\$ is as small as possible. You must swap ...
Wheat Wizard's user avatar
  • 97.6k
11 votes
3 answers

Challenge Similarity Detector

Challenge Given two question IDs, try to figure out how similar they are by looking at the answers. Details You will be given two question IDs for ...
hyper-neutrino's user avatar
  • 41.4k
4 votes
1 answer

String Similarity using Jaro-Winkler

String Similarity String similarity is basically a ratio of how similar one string is to another. This can be calculated in many ways, and there are various algorithms out there for implementing a ...
Magic Octopus Urn's user avatar