Tag Archives: String

Palindrome in python

String palindrome in python Write python code to find palindrome strings. A Palendrome string can be read the same from either direction left to right or right to left. Palindrome python code Here is a palindrome algorithm python code. You …

Read more »

Python anagram solver

Anagram solver in python Two strings are anagrams if they contain the same set of characters regardless of the order of individual characters such as “earth” and “heart”. Write python code to detect if two strings are anagrams. Python anagram …

Read more »

Find repeated characters in python

Python repeated character in string Given a string of characters. Write python code to print the repeated characters Solution This is a typical dictionary based problem. Here is how to do that in Python. # Input string str = “Computers …

Read more »

Java String Array Iterator Example

Problem Given the signature of the Java method below public static Iterator iterateStrings(String… strings) Provide implementation that iterates through each string in the order that they are provided but it skips null values Solution We implement the Iterable interface. We …

Read more »

Dynamic Programming Edit Distance

Edit Distance or Levenshtein Distance Welcome! This is part eight in a series of articles on Dynamic Programming. You can start at the beginning of this series if you wish by clicking here. Today we are going to talk about …

Read more »

Lexicographic Order in Java

Lexicographic Order Problem Write java method to compare two strings lexicographically. The method should return 0 if the two strings are Lexicographically equal. It should return 1 if the first string comes before the second string in the dictionary. It …

Read more »

Java Replace String Function

Problem Write a Java method to replace a sub string in a given text with another string of the same size Solution Loop through the text character by character. Starting at the current character loop a number of times equal …

Read more »

Page 1 of 41234