# Category: String

## Find all N-digit numbers with given sum of digits

Find all N-digit numbers with equal sum. N varies from [1 to 9] and sum < = 81 (Maximum possible sum in a 9-digit number). Get great deals at Amazon

## Implement Diff Utility

Implement your own diff utility. i.e given two similar strings, efficiently list out all differences between them.

## Calculate rank of given string among all its lexicographically sorted permutations

Given a string, calculate its rank among all its lexicographically sorted permutations.

## Remove adjacent duplicate characters from a string

Given a string, remove adjacent duplicates characters from it. In other words, remove all consecutive same characters except one.

## Determine if a pattern matches with a string or not

Given a string and a pattern, determine if the pattern matches with the string or not. The solution should not use any regex.

## Check if a string is K-Palindrome or not

A string is K-Palindrome if it becomes a palindrome on removing at most k characters from it. Write an algorithm to check if a given string is K-Palindrome or not.

## Implementation of KMP Algorithm in C, C++ and Java

In this post, we will implement KMP Algorithm in C, C++ and Java programming language.

## Break a string into all possible combinations of non-overlapping substrings

Given a string, break it into all possible combinations of non-overlapping substrings enclosed within curly brackets.

## Find minimum number possible by doing at-most K swaps

Given a positive integer, find minimum number possible by doing at-most K swap operations upon its digits.

## Longest Common Subsequence of K-sequences

The longest common subsequence (LCS) problem is the problem of finding the longest subsequence that is present in given two sequences in the same order. i.e. find a longest sequence which can be obtained from the first original sequence by deleting some items, and from the second original sequence by deleting other items.

## Iterative approach to find permutations of a string in C++ and Java

In this post, we will discuss how to find permutations of a string using iteration.

## Find all N-digit strictly increasing numbers (Bottom-Up and Top-Down Approach)

Find all N-digit strictly increasing numbers where N varies from [1 to 9]. If we process the number from left to right and for every pair of adjacent digits, if every digit is greater than the preceding digit, we can say that the digits are strictly increasing.