<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    emu in blogjava

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
      171 隨筆 :: 103 文章 :: 1052 評論 :: 2 Trackbacks

    Problem Statement
    ????
    You want to buy two neighboring tickets in the first row of the theater so that one of the tickets is as far from the aisles as possible.
    You will be given a String describing the first row of the theater where '.' represents an empty seat and 'X' represents an occupied seat. Your task is to return the index (from 0) of the empty seat that is furthest from the aisles (the two ends of the String) and is also next to an empty seat. If there are multiple possible seats, return the one with the smallest index. Return -1 if there are no seats that satisfy your requirements.
    Definition
    ????
    Class:
    TheaterVisit
    Method:
    chooseSeat
    Parameters:
    String
    Returns:
    int
    Method signature:
    int chooseSeat(String row)
    (be sure your method is public)
    ????

    Constraints
    -
    row will contain between 1 and 50 characters, inclusive.
    -
    Each character in row will be either '.' or 'X'.
    Examples
    0)

    ????
    "....."
    Returns: 2
    You can buy either tickets with indexes 1 and 2 or tickets with indexes 2 and 3.
    1)

    ????
    "......"
    Returns: 2

    2)

    ????
    "..X..."
    Returns: 3
    You should buy tickets with indexes 3 and 4.
    3)

    ????
    ".X.X..."
    Returns: 4

    4)

    ????
    "X.XX.X"
    Returns: -1

    5)

    ????
    ".."
    Returns: 0

    This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.

    posted on 2005-12-20 10:27 emu 閱讀(1441) 評論(0)  編輯  收藏 所屬分類: google編程大賽模擬題及入圍賽真題
    主站蜘蛛池模板: 亚洲好看的理论片电影| 亚洲视频在线观看网址| 国产高清对白在线观看免费91| 亚洲国产高清精品线久久| gogo免费在线观看| 亚洲熟妇av一区二区三区漫画| 两个人看的www高清免费观看| 久久丫精品国产亚洲av| 毛片免费在线播放| 中文字幕不卡免费视频| 亚洲另类春色校园小说| 亚洲av无码国产精品色在线看不卡 | 亚洲日韩一中文字暮| 国产亚洲成人在线播放va| 中文字幕乱码免费视频| 搜日本一区二区三区免费高清视频| 亚洲日产韩国一二三四区| 永久免费av无码不卡在线观看| 一区二区三区AV高清免费波多| 久久亚洲精品无码VA大香大香| 日本免费一区二区三区最新 | 好男人视频在线观看免费看片| 一级毛片免费在线| 亚洲色无码专区一区| 亚洲国产精品久久| 久久久久亚洲AV成人网| 国产成人无码免费视频97 | 毛片a级毛片免费播放下载| 无码av免费一区二区三区| 乱淫片免费影院观看| 亚洲熟妇无码AV| 亚洲校园春色小说| 亚洲精品综合久久中文字幕| 中文字幕人成人乱码亚洲电影| 波多野结衣在线免费视频| GOGOGO高清免费看韩国| 一级特黄色毛片免费看| 国产精品成人亚洲| 亚洲AV无码精品国产成人| 亚洲色无码国产精品网站可下载 | 国产在线观看免费av站|