在伦敦地铁又名地铁是世界上最古老的地下铁路,它目前由11行(因为“Edgware路”和“哈默”各占据两个位置严格269 **站)* 267个服务站命名
挑战
输出以名称为输入的服务站的线路名称。
输入:
字符串或字符列表
可以假定这是一个有效的站名(如下面的代码块中所列)。
您可以假设
&
输入中的任何内容将始终是单词and
(或And
),如果您愿意,只需在答案中清楚说明即可。
输出:
单独的输出列出了服务该站的十一条线路的输出:
字符串列表,字符列表,打印文本,字符串,字符列表;如果有疑问请问。
如果愿意,您可以始终输出单词
and
(或And
)代替任何单词&
,只需在答案中清楚说明。需要注意的是,如果打印或返回一个字符串或字符列表,则在任何行名(包括the
&
或and
orAnd
used)中都不存在使用的分隔符-子字符串-因此,这排除了使用单个空格字符作为分隔符。
试管网络:
-注意:这是最终状态,即使它碰巧包含拼写错误(除非在回答前得到解决)
Input (Station Name) : Output (list of tube line names)
----------------------------------------------------------------------------------------------------------------
"Acton Town" : ["District","Piccadilly"]
"Aldgate" : ["Circle","Metropolitan"]
"Aldgate East" : ["District","Hammersmith & City"]
"Alperton" : ["Piccadilly"]
"Amersham" : ["Metropolitan"]
"Angel" : ["Northern"]
"Archway" : ["Northern"]
"Arnos Grove" : ["Piccadilly"]
"Arsenal" : ["Piccadilly"]
"Baker Street" : ["Bakerloo","Circle","Hammersmith & City","Jubilee","Metropolitan"]
"Balham" : ["Northern"]
"Bank" : ["Central","Northern","Waterloo & City"]
"Barbican" : ["Circle","Hammersmith & City","Metropolitan"]
"Barking" : ["District","Hammersmith & City"]
"Barkingside" : ["Central"]
"Barons Court" : ["District","Piccadilly"]
"Bayswater" : ["Circle","District"]
"Becontree" : ["District"]
"Belsize Park" : ["Northern"]
"Bermondsey" : ["Jubilee"]
"Bethnal Green" : ["Central"]
"Blackfriars" : ["Circle","District"]
"Blackhorse Road" : ["Victoria"]
"Bond Street" : ["Central","Jubilee"]
"Borough" : ["Northern"]
"Boston Manor" : ["Piccadilly"]
"Bounds Green" : ["Piccadilly"]
"Bow Road" : ["District","Hammersmith & City"]
"Brent Cross" : ["Northern"]
"Brixton" : ["Victoria"]
"Bromley-by-Bow" : ["District","Hammersmith & City"]
"Buckhurst Hill" : ["Central"]
"Burnt Oak" : ["Northern"]
"Caledonian Road" : ["Piccadilly"]
"Camden Town" : ["Northern"]
"Canada Water" : ["Jubilee"]
"Canary Wharf" : ["Jubilee"]
"Canning Town" : ["Jubilee"]
"Cannon Street" : ["Circle","District"]
"Canons Park" : ["Jubilee"]
"Chalfont & Latimer" : ["Metropolitan"]
"Chalk Farm" : ["Northern"]
"Chancery Lane" : ["Central"]
"Charing Cross" : ["Bakerloo","Northern"]
"Chesham" : ["Metropolitan"]
"Chigwell" : ["Central"]
"Chiswick Park" : ["District"]
"Chorleywood" : ["Metropolitan"]
"Clapham Common" : ["Northern"]
"Clapham North" : ["Northern"]
"Clapham South" : ["Northern"]
"Cockfosters" : ["Piccadilly"]
"Colindale" : ["Northern"]
"Colliers Wood" : ["Northern"]
"Covent Garden" : ["Piccadilly"]
"Croxley" : ["Metropolitan"]
"Dagenham East" : ["District"]
"Dagenham Heathway" : ["District"]
"Debden" : ["Central"]
"Dollis Hill" : ["Jubilee"]
"Ealing Broadway" : ["Central","District"]
"Ealing Common" : ["District","Piccadilly"]
"Earl's Court" : ["District","Piccadilly"]
"East Acton" : ["Central"]
"East Finchley" : ["Northern"]
"East Ham" : ["District","Hammersmith & City"]
"East Putney" : ["District"]
"Eastcote" : ["Metropolitan","Piccadilly"]
"Edgware" : ["Northern"]
"Edgware Road" : ["Bakerloo","Circle","District","Hammersmith & City"]
"Elephant & Castle" : ["Bakerloo","Northern"]
"Elm Park" : ["District"]
"Embankment" : ["Bakerloo","Circle","District","Northern"]
"Epping" : ["Central"]
"Euston" : ["Northern","Victoria"]
"Euston Square" : ["Circle","Hammersmith & City","Metropolitan"]
"Fairlop" : ["Central"]
"Farringdon" : ["Circle","Hammersmith & City","Metropolitan"]
"Finchley Central" : ["Northern"]
"Finchley Road" : ["Jubilee","Metropolitan"]
"Finsbury Park" : ["Piccadilly","Victoria"]
"Fulham Broadway" : ["District"]
"Gants Hill" : ["Central"]
"Gloucester Road" : ["Circle","District","Piccadilly"]
"Golders Green" : ["Northern"]
"Goldhawk Road" : ["Circle","Hammersmith & City"]
"Goodge Street" : ["Northern"]
"Grange Hill" : ["Central"]
"Great Portland Street" : ["Circle","Hammersmith & City","Metropolitan"]
"Greenford" : ["Central"]
"Green Park" : ["Jubilee","Piccadilly","Victoria"]
"Gunnersbury" : ["District"]
"Hainault" : ["Central"]
"Hammersmith" : ["Circle","District","Hammersmith & City","Piccadilly"]
"Hampstead" : ["Northern"]
"Hanger Lane" : ["Central"]
"Harlesden" : ["Bakerloo"]
"Harrow & Wealdstone" : ["Bakerloo"]
"Harrow-on-the-Hill" : ["Metropolitan"]
"Hatton Cross" : ["Piccadilly"]
"Heathrow Terminals 1, 2, 3" : ["Piccadilly"]
"Heathrow Terminal 4" : ["Piccadilly"]
"Heathrow Terminal 5" : ["Piccadilly"]
"Hendon Central" : ["Northern"]
"High Barnet" : ["Northern"]
"Highbury & Islington" : ["Victoria"]
"Highgate" : ["Northern"]
"High Street Kensington" : ["Circle","District"]
"Hillingdon" : ["Metropolitan","Piccadilly"]
"Holborn" : ["Central","Piccadilly"]
"Holland Park" : ["Central"]
"Holloway Road" : ["Piccadilly"]
"Hornchurch" : ["District"]
"Hounslow Central" : ["Piccadilly"]
"Hounslow East" : ["Piccadilly"]
"Hounslow West" : ["Piccadilly"]
"Hyde Park Corner" : ["Piccadilly"]
"Ickenham" : ["Metropolitan","Piccadilly"]
"Kennington" : ["Northern"]
"Kensal Green" : ["Bakerloo"]
"Kensington (Olympia)" : ["District"]
"Kentish Town" : ["Northern"]
"Kenton" : ["Bakerloo"]
"Kew Gardens" : ["District"]
"Kilburn" : ["Jubilee"]
"Kilburn Park" : ["Bakerloo"]
"Kingsbury" : ["Jubilee"]
"King's Cross St. Pancras" : ["Circle","Hammersmith & City","Metropolitan","Northern","Piccadilly","Victoria"]
"Knightsbridge" : ["Piccadilly"]
"Ladbroke Grove" : ["Circle","Hammersmith & City"]
"Lambeth North" : ["Bakerloo"]
"Lancaster Gate" : ["Central"]
"Latimer Road" : ["Circle","Hammersmith & City"]
"Leicester Square" : ["Northern","Piccadilly"]
"Leyton" : ["Central"]
"Leytonstone" : ["Central"]
"Liverpool Street" : ["Central","Circle","Hammersmith & City","Metropolitan"]
"London Bridge" : ["Jubilee","Northern"]
"Loughton" : ["Central"]
"Maida Vale" : ["Bakerloo"]
"Manor House" : ["Piccadilly"]
"Mansion House" : ["Circle","District"]
"Marble Arch" : ["Central"]
"Marylebone" : ["Bakerloo"]
"Mile End" : ["Central","District","Hammersmith & City"]
"Mill Hill East" : ["Northern"]
"Monument" : ["Circle","District"]
"Moorgate" : ["Circle","Hammersmith & City","Metropolitan","Northern"]
"Moor Park" : ["Metropolitan"]
"Morden" : ["Northern"]
"Mornington Crescent" : ["Northern"]
"Neasden" : ["Jubilee"]
"Newbury Park" : ["Central"]
"North Acton" : ["Central"]
"North Ealing" : ["Piccadilly"]
"North Greenwich" : ["Jubilee"]
"North Harrow" : ["Metropolitan"]
"North Wembley" : ["Bakerloo"]
"Northfields" : ["Piccadilly"]
"Northolt" : ["Central"]
"Northwick Park" : ["Metropolitan"]
"Northwood" : ["Metropolitan"]
"Northwood Hills" : ["Metropolitan"]
"Notting Hill Gate" : ["Central","Circle","District"]
"Oakwood" : ["Piccadilly"]
"Old Street" : ["Northern"]
"Osterley" : ["Piccadilly"]
"Oval" : ["Northern"]
"Oxford Circus" : ["Bakerloo","Central","Victoria"]
"Paddington" : ["Bakerloo","Circle","District","Hammersmith & City"]
"Park Royal" : ["Piccadilly"]
"Parsons Green" : ["District"]
"Perivale" : ["Central"]
"Piccadilly Circus" : ["Bakerloo","Piccadilly"]
"Pimlico" : ["Victoria"]
"Pinner" : ["Metropolitan"]
"Plaistow" : ["District","Hammersmith & City"]
"Preston Road" : ["Metropolitan"]
"Putney Bridge" : ["District"]
"Queen's Park" : ["Bakerloo"]
"Queensbury" : ["Jubilee"]
"Queensway" : ["Central"]
"Ravenscourt Park" : ["District"]
"Rayners Lane" : ["Metropolitan","Piccadilly"]
"Redbridge" : ["Central"]
"Regent's Park" : ["Bakerloo"]
"Richmond" : ["District"]
"Rickmansworth" : ["Metropolitan"]
"Roding Valley" : ["Central"]
"Royal Oak" : ["Circle","Hammersmith & City"]
"Ruislip" : ["Metropolitan","Piccadilly"]
"Ruislip Gardens" : ["Central"]
"Ruislip Manor" : ["Metropolitan","Piccadilly"]
"Russell Square" : ["Piccadilly"]
"St. James's Park" : ["Circle","District"]
"St. John's Wood" : ["Jubilee"]
"St. Paul's" : ["Central"]
"Seven Sisters" : ["Victoria"]
"Shepherd's Bush" : ["Central"]
"Shepherd's Bush Market" : ["Circle","Hammersmith & City"]
"Sloane Square" : ["Circle","District"]
"Snaresbrook" : ["Central"]
"South Ealing" : ["Piccadilly"]
"South Harrow" : ["Piccadilly"]
"South Kensington" : ["Circle","District","Piccadilly"]
"South Kenton" : ["Bakerloo"]
"South Ruislip" : ["Central"]
"South Wimbledon" : ["Northern"]
"South Woodford" : ["Central"]
"Southfields" : ["District"]
"Southgate" : ["Piccadilly"]
"Southwark" : ["Jubilee"]
"Stamford Brook" : ["District"]
"Stanmore" : ["Jubilee"]
"Stepney Green" : ["District","Hammersmith & City"]
"Stockwell" : ["Northern","Victoria"]
"Stonebridge Park" : ["Bakerloo"]
"Stratford" : ["Central","Jubilee"]
"Sudbury Hill" : ["Piccadilly"]
"Sudbury Town" : ["Piccadilly"]
"Swiss Cottage" : ["Jubilee"]
"Temple" : ["Circle","District"]
"Theydon Bois" : ["Central"]
"Tooting Bec" : ["Northern"]
"Tooting Broadway" : ["Northern"]
"Tottenham Court Road" : ["Central","Northern"]
"Tottenham Hale" : ["Victoria"]
"Totteridge & Whetstone" : ["Northern"]
"Tower Hill" : ["Circle","District"]
"Tufnell Park" : ["Northern"]
"Turnham Green" : ["District","Piccadilly"]
"Turnpike Lane" : ["Piccadilly"]
"Upminster" : ["District"]
"Upminster Bridge" : ["District"]
"Upney" : ["District"]
"Upton Park" : ["District","Hammersmith & City"]
"Uxbridge" : ["Metropolitan","Piccadilly"]
"Vauxhall" : ["Victoria"]
"Victoria" : ["Circle","District","Victoria"]
"Walthamstow Central" : ["Victoria"]
"Wanstead" : ["Central"]
"Warren Street" : ["Northern","Victoria"]
"Warwick Avenue" : ["Bakerloo"]
"Waterloo" : ["Bakerloo","Jubilee","Northern","Waterloo & City"]
"Watford" : ["Metropolitan"]
"Wembley Central" : ["Bakerloo"]
"Wembley Park" : ["Jubilee","Metropolitan"]
"West Acton" : ["Central"]
"West Brompton" : ["District"]
"West Finchley" : ["Northern"]
"West Ham" : ["District","Hammersmith & City","Jubilee"]
"West Hampstead" : ["Jubilee"]
"West Harrow" : ["Metropolitan"]
"West Kensington" : ["District"]
"West Ruislip" : ["Central"]
"Westbourne Park" : ["Circle","Hammersmith & City"]
"Westminster" : ["Circle","District","Jubilee"]
"White City" : ["Central"]
"Whitechapel" : ["District","Hammersmith & City"]
"Willesden Green" : ["Jubilee"]
"Willesden Junction" : ["Bakerloo"]
"Wimbledon" : ["District"]
"Wimbledon Park" : ["District"]
"Wood Green" : ["Piccadilly"]
"Wood Lane" : ["Circle","Hammersmith & City"]
"Woodford" : ["Central"]
"Woodside Park" : ["Northern"]
...十一行名称是:
Bakerloo
Central
Circle
District
Hammersmith & City
Jubilee
Metropolitan
Northern
Piccadilly
Victoria
Waterloo & City
*运输对于伦敦来说,它也管理其他火车线路,有些也可能被称为“地铁”的一部分(很可能是“港区轻轨”或“ DLR”),但我们将坚持此处列出的十一条。
**链接的Wikipedia页面当前显示270,但是我相信他们错误地算出了Canary Wharf的第二个位置,即使它仅服务于“ DLR”)
使用Mornington Crescent(此处提供兼容的IDE )进行高尔夫投稿时,会产生假想的布朗尼点(可能还会有很多投票)!
这是代码高尔夫球,因此,每种语言以字节为单位的最短代码获胜,而解决方案的最短者获胜(不要让打高尔夫的语言让您以其他语言打高尔夫)。玩得开心!