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, ...
  • 5,333
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 ...
  • 41.9k
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\$. ...
  • 5,087
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 ...
11 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, ...
  • 13.6k
8 votes
5 answers

I misspelled my domayn name

According to Alexa rankings, the top 10 websites are: ...
  • 3,899
21 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 ...
  • 8,050
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 ...
  • 92.5k
9 votes
4 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
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 ...
  • 40.6k
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 ...