लंदन भूमिगत उर्फ ट्यूब दुनिया में सबसे पुराना भूमिगत रेलवे, यह वर्तमान में (के बाद से "एडगवेयर रोड 'और' हैमरस्मिथ" प्रत्येक दो स्थानों पर कब्जा सख्ती से 269 ** स्टेशनों) 267 नामित स्टेशनों सर्विसिंग * ग्यारह लाइनें शामिल है
चुनौती
इनपुट के रूप में नाम से दिए गए स्टेशन की सर्विसिंग लाइनों के नाम आउटपुट करें।
इनपुट:
एक स्ट्रिंग या पात्रों की सूची
इसे एक मान्य स्टेशन नाम माना जा सकता है (जैसा कि नीचे दिए गए कोड-ब्लॉक में सूचीबद्ध है)।
आप मान सकते हैं किसी भी
&
इनपुट में होगा लगातार शब्द होand
(याAnd
) के बजाय यदि आप चाहें तो, बस इसे स्पष्ट रूप से उल्लेख अपने जवाब में।
आउटपुट: उस स्टेशन की सेवा करने वाली ग्यारह लाइनों की
अलग-अलग आउटपुट लिस्टिंग:
तार की एक सूची, पात्रों की सूची, मुद्रित पाठ, एक स्ट्रिंग, पात्रों की एक सूची; अगर संदेह में पूछें।
यदि आप चाहें तो आप किसी भी शब्द के स्थान पर लगातार शब्द
and
(याAnd
) का उत्पादन कर सकते हैं&
, बस अपने उत्तर में यह स्पष्ट रूप से बताएं।चेतावनी है कि मुद्रण या एक स्ट्रिंग या अक्षरों की सूची लौटने कि विभाजक-सबस्ट्रिंग इस्तेमाल किया लाइन नामों में से किसी में मौजूद नहीं है अगर (सहित के साथ
&
याand
याAnd
इस इसलिए शामिल नहीं विभाजक के रूप में एक भी अंतरिक्ष चरित्र के उपयोग - प्रयुक्त) ।
ट्यूब नेटवर्क :
- नोट: यह अंतिम स्थिति है, भले ही इसमें वर्तनी की गलती हो (जब तक कि किसी भी उत्तर से पहले पता न चले)
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
* ट्रांसपोर्ट फ़ॉर लंदन अन्य ट्रेन लाइनों का भी प्रबंधन करता है, कुछ को "द ट्यूब" (ज्यादातर "डॉकलैंड लाइट रेलवे" या "डीएलआर") का हिस्सा भी कहा जा सकता है, लेकिन हम यहां सूचीबद्ध ग्यारह से चिपके रहेंगे।
** लिंक किए गए विकिपीडिया पृष्ठ में वर्तमान में 270 हैं, लेकिन मेरा मानना है कि वे गलती से कैनरी घाट के दूसरे स्थान की गिनती कर रहे हैं, भले ही यह "डीएलआर" सेवा प्रदान करता है)
मॉर्निंगटन क्रिसेंट (एक संगत आईडीई यहां उपलब्ध है ) का उपयोग करके एक गोल्फ जमा करने के लिए काल्पनिक ब्राउनी अंक (और सबसे अधिक संभावना कई अपवोट भी) के ढेर !
यह कोड-गोल्फ है , इसलिए बाइट्स में सबसे छोटा कोड प्रति भाषा जीतता है और सबसे छोटा समाधान जीतता है (गोल्फिंग भाषाओं को आपको अन्य भाषाओं में गोल्फ खेलने से दूर न करें)। मज़े करो!