0

I am preparing for interviews and am trying to understand this problem:

Write a program to track set of text ranges. Start point and end point will be string.

Text range example : [AbA-Ef]

  • Aa would fall before this range
  • AB would fall inside this range
  • etc.

Can someone help me understand how Text range [AbA-Ef] is defined?

  • Is AbA a start point and Ef an endpoint?

  • I can conceptually understand start point of char A, but I do not get start point AbA. Is it like number line where char A, a, B, b, C, c fall on the line?

  • It is like regular expression where start point AbA imply all the strings that start with prefix AbA?

  • is it [AbA] to [Ef]?

  • or {Ab} + [A-E] + {f}?

Thanks in advance.

pah
  • 4,700
  • 6
  • 28
  • 37
Generic Person
  • 351
  • 1
  • 5
  • 10
  • Using that syntax for a range of strings is misleading, since it's so similar to the character class syntax of regular expressions but with a very different meaning. – Keith Thompson Jul 27 '16 at 22:31
  • @KeithThompson - So true, the syntax is definitely misleading. Being an interview question, not sure if this was part of the "puzzle". – Generic Person Jul 29 '16 at 00:02

1 Answers1

0

That reads to me as just an alphabetical range, but treating UC letters as coming after lc letters (based on AB coming after AbA). Like if you were to look in a physical encyclopedia, there might be headings on the pages like "chuck - chunk", so if you were looking for "chimp" you'd know to go back a few pages, if you were looking for "chute" you'd keep going forward, or if you were looking for "chump" you'd know it was on that page somewhere. Maybe I'm just old.

Will
  • 2,163
  • 1
  • 22
  • 22
  • Thanks a ton user866762. So obvious and yet so unintuitive, I used physical dictionary in last decade and once I think in that domain, it makes perfect sense now. – Generic Person Jul 25 '16 at 22:24