网页学习体会

  • 首页
  • 个人博客
您的位置: 首页  >  IT文章  >  LeetCode824.Goat Latin

LeetCode824.Goat Latin

分类: IT文章 • 2022-07-25 16:36:59
class Solution:
    def toGoatLatin(self, S):
        """
        :type S: str
        :rtype: str
        """
        sList = S.split()
        ch = ''
        for item in sList:
            index = sList.index(item)
            if item[0] in "aeiouAEIOU":
                ch = item + "ma"
                sList[index] = ch
            else:
                ch = item[1:] + item[0] + "ma"
                sList[index] = ch
        ch = ''
        lastIndex = -1
        for item in sList:
            index = sList.index(item, lastIndex + 1)
            lastIndex = index
            ch += item + 'a'*(index + 1) + " "
        return ch[:len(ch)-1]
LeetCode824.Goat Latin

相关推荐

  • utf8_client_read_mysql_table_in_latin1
  • COLLATION 'latin1_swedish_ci' is not valid for CHARACTER SET 'utf8'
  • python3 中文乱码,UnicodeEncodeError: 'latin-1' codec can't encode characters in position 10-13: ordinal not in range(256)
  • Django中文无法转换成latin-1编码的解决方案
  • LeetCode 824. Goat Latin
  • Latin1的所有字符编码 ISO-8859-1 (ISO Latin 1) Character Encoding
  • sql server 小技艺(6) Cannot resolve the collation conflict between "Latin1_General_CI_AI" and "Chinese_PRC_CI_AS" in the equal to operation
  • SQL_Latin1_General_CP1_CI_AS 如何查询出来汉字列,显示汉字,不是乱码
  • 题解-CF1458C Latin Square
  • ISO Latin-一字符集
  • Conditional Random Fields as Recurrent Neural Networks阅读笔记
  • LeetCode118.杨辉三角
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 网页学习体会    备案号:   粤ICP备20002247号