Блог пользователя K_B_C_S

Автор K_B_C_S, история, 6 лет назад, По-английски

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!

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор K_B_C_S, история, 7 лет назад, По-английски

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!

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится