Skip to main content

All Questions

Filter by
Sorted by
Tagged with
3 votes
2 answers
1k views

Counting the number of ways to decode a string

I am working on problem where I need to decode a string: A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... '...
user5447339's user avatar
3 votes
2 answers
593 views

Find the longest sub string of a word after concatenation of given words array

An Array of N words is given. Each word consists of small letters ('a'-'z'). Our goal is to concatenate the words in such a way as to obtain a single word with longest possible substring composed of ...
Ora2gaurav's user avatar
1 vote
1 answer
500 views

Reinterpreting a string, treating < as a backspace character

I've come up with a solution to this coding challenge using recursion. In summary, the input is a string where the < symbol represents a backspace (up to 1 ...
Archie Gertsman's user avatar
1 vote
4 answers
3k views

Split a long string using recursive function

I have executed a program which reads long string and divide the string on basis of specified input. Well I am getting the correct output but would try it to be more efficient and readable. Opinions ...
Vaibs's user avatar
  • 155
4 votes
1 answer
304 views

String permutations

So I have tried the famous string permutation algorithm. Example for those who are not familiar with the algorithm: ABC -> ...
cmplx96's user avatar
  • 143
3 votes
2 answers
2k views

Longest repeating and non-overlapping substring

Given a string find the length of longest repeating non-overlapping substring in it. In other words, find 2 identical substrings of maximum length which do not overlap. Examples: Input : str = "...
Shridhar R Kulkarni's user avatar
3 votes
2 answers
3k views

Non-Contiguous Substrings

Problem: A non-contiguous substring of string \$s\$ is a sequence of \$k \geq 0\$ characters in \$s\$, in the order in which they occur in \$s\$. For instance, the set of all non-contiguous ...
francium's user avatar
  • 139
2 votes
3 answers
732 views

To check if a string C is an interleaving of A and B Code

This is my code to check if a string C is an interleaving of Strings A and B. Please suggests optimizations, and where I can improve. ...
amiageek's user avatar
4 votes
1 answer
801 views

Printing all strings in a Boggle board

I am trying to print all the strings given in a N x N Boggle board. Its basically a N x N scrabble-like board where words can be made from a position - horizontally, vertically and diagonally. Here ...
user110036's user avatar
1 vote
1 answer
3k views

Recursion to map phone number to strings

I am trying to solve the following via recursion: In a phone we have each digit mapped to a number. Example: ...
user384706's user avatar