<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精品免费国产高清在线| 97免费人妻无码视频| 国内自产拍自a免费毛片| 大陆一级毛片免费视频观看i| 亚洲AV一宅男色影视| 一区二区视频免费观看| 亚洲第一区精品观看| 国产亚洲成在线播放va| 免费v片在线观看无遮挡| 国产精品亚洲精品久久精品| 国产精品99久久免费观看| 亚洲精品中文字幕乱码三区 | 99久久综合国产精品免费| 亚洲av麻豆aⅴ无码电影| 日韩色视频一区二区三区亚洲| 免费观看四虎精品国产永久| 亚洲国产成人私人影院| 亚欧免费无码aⅴ在线观看| 午夜爱爱免费视频| 在线播放亚洲精品| 亚洲国产香蕉人人爽成AV片久久 | 野花香在线视频免费观看大全 | 野花香在线视频免费观看大全 | 最近2019中文免费字幕在线观看 | 黄色网址免费在线观看| 又黄又爽又成人免费视频| 亚洲日本乱码卡2卡3卡新区| 国产成人精品免费视频大全| 国产AV无码专区亚洲Av| 久久综合国产乱子伦精品免费 | 国产精品免费视频一区| 亚洲嫩模在线观看| 亚洲精品动漫免费二区| 国产午夜亚洲精品不卡免下载 | 18gay台湾男同亚洲男同| 特黄特色的大片观看免费视频| 国产AV无码专区亚洲AV漫画| 99久热只有精品视频免费看 | 亚洲av无码一区二区三区在线播放| heyzo亚洲精品日韩| 99蜜桃在线观看免费视频网站|