K_B_C_S's blog

By K_B_C_S, history, 6 years ago, In English

Check if a master string contains all the strings given in a list. Also, strings should not overlap.

example:

1) "indiaismycountry" is a master string which contains all strings {"is", "country, india"}.

2) "animal" is a master string which doesn't contains {"an", "animal"}.

This question not form any running contest. I is asked in a interview.

Any solution or useful link will be helpful.

Thanks in advance!

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By K_B_C_S, history, 7 years ago, In English

Given a set of pairs. Each pair represent a range of numbers. Example (5, 8) represents {5, 6, 7, 8}. I want to find in which pair an element x is present, it is sure that element x exits in at least one pair?

Can this be solved in logarithmic time? Thanks in advance!

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it