Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.

All Questions

Filter by
Sorted by
Tagged with
3 votes
1 answer
98 views

Build a dictionary from a string by the extraction of data from all the pairs <TAG|VAL> contained inside the string and clean string from TAGs

I have written code to manage a string and retrieve from it a dictionary which must contain pairs key-value dependent from the string. To be more clear I'll show ...
User051209's user avatar
3 votes
1 answer
2k views

Palindrome implementations - iterative and recursive

I got asked this palindrome question when the interviewer wants to make sure that my palindrome can check if "Taco! Cat!" is a palindrome. In this example, my palindromes implementation needs to ...
NinjaG's user avatar
  • 2,559
10 votes
3 answers
1k views

indexOf Boyer-Moore String Search algorithm

This is an implementation of Boyer-Moore string search algorithm index_of for a pattern in text. I was challenged to implement it by my friend. This Python ...
NinjaG's user avatar
  • 2,559
10 votes
1 answer
1k views

Osherove TDD Kata 1: String Calculator

I implemented Roy Osherove's TDD Kata 1: String Calculator using Python 3.5.2 and the unittest module. The full description can be found at the link, it's a bit ...
Phrancis's user avatar
  • 20.5k
3 votes
4 answers
527 views

Are the words isomorph?

Are the words isomorphs? (Code-Golf) This is my non-golfed, readable and linear (quasi-linear?) in complexity take of the above problem. For completeness I include the description: Two words are ...
Caridorc's user avatar
  • 28k
2 votes
1 answer
1k views

TDD: String Calculator Kata

String Calculator Create a simple String calculator with a method int Add(string numbers). The method can take 0, 1 or 2 numbers, and will return ...
Caridorc's user avatar
  • 28k
1 vote
1 answer
40 views

Splitting a string basing myself on categories

I was thinking about splitting a string based on certain categories, for example alphabetic and numerical, lower and upper case, and even the 3 lines of the keyboard. I wrote a generic function for ...
Caridorc's user avatar
  • 28k
1 vote
2 answers
680 views

Counting length-2 substrings that are common to two strings at the same offset -- Python

I solved the CodingBat task: Given 2 strings, a and b, return the number of the positions where they contain the same length 2 substring. So "xxcaazz" and "xxbaaz" yields 3, since ...
Caridorc's user avatar
  • 28k