博客
关于我
4.14华为研发岗机试其中一道编程题
阅读量:173 次
发布时间:2019-02-28

本文共 952 字,大约阅读时间需要 3 分钟。

???????????????????????o(???)o???????????????????????????????????????????(??????)?????????????????????????????????????????(?_?)?????????????????????????????????????????????~~o(>_<)o~~?

?????????????????????????????????????????????????????

def circle(s_str):    stack = []    for i in range(len(s_str)):        if s_str[i] == '(':            stack.append(i)    if not s_str or '(' not in s_str:        return s_str    else:        lIndex = stack.pop()        for i in range(lIndex + 1, len(s_str)):            if s_str[i] == ')':                rIndex = i                break        res = s_str[:lIndex] + s_str[rIndex - 1:lIndex:-1] + s_str[rIndex + 1: len(s_str)]        return circle(res)s = input().split()s_str = ''.join(s)print(circle(s_str))

????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

????????????????????????????????????(??????????)??????????????????????????????????????

转载地址:http://nqxn.baihongyu.com/

你可能感兴趣的文章
npm的问题:config global `--global`, `--local` are deprecated. Use `--location=global` instead 的解决办法
查看>>
npm编译报错You may need an additional loader to handle the result of these loaders
查看>>
npm设置淘宝镜像、升级等
查看>>
npm设置源地址,npm官方地址
查看>>
npm配置安装最新淘宝镜像,旧镜像会errror
查看>>
NPM酷库052:sax,按流解析XML
查看>>
npm错误 gyp错误 vs版本不对 msvs_version不兼容
查看>>
npm错误Error: Cannot find module ‘postcss-loader‘
查看>>
npm,yarn,cnpm 的区别
查看>>
NPOI之Excel——合并单元格、设置样式、输入公式
查看>>
NPOI初级教程
查看>>
NPOI利用多任务模式分批写入多个Excel
查看>>
NPOI在Excel中插入图片
查看>>
NPOI将某个程序段耗时插入Excel
查看>>
NPOI格式设置
查看>>
NPOI设置单元格格式
查看>>
Npp删除选中行的Macro录制方式
查看>>
NR,NF,FNR
查看>>
nrf24l01+arduino
查看>>
nrf开发笔记一开发软件
查看>>