博客
关于我
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/

你可能感兴趣的文章
Netty源码—7.ByteBuf原理三
查看>>
Netty源码—7.ByteBuf原理四
查看>>
Netty源码—8.编解码原理二
查看>>
Netty源码解读
查看>>
Netty的Socket编程详解-搭建服务端与客户端并进行数据传输
查看>>
Netty相关
查看>>
Network Dissection:Quantifying Interpretability of Deep Visual Representations(深层视觉表征的量化解释)
查看>>
Network Sniffer and Connection Analyzer
查看>>
Net与Flex入门
查看>>
net包之IPConn
查看>>
NFinal学习笔记 02—NFinalBuild
查看>>
NFS共享文件系统搭建
查看>>
nfs复习
查看>>
NFS网络文件系统
查看>>
ng 指令的自定义、使用
查看>>
nginx + etcd 动态负载均衡实践(二)—— 组件安装
查看>>
nginx + etcd 动态负载均衡实践(四)—— 基于confd实现
查看>>
Nginx + uWSGI + Flask + Vhost
查看>>
Nginx - Header详解
查看>>
Nginx Location配置总结
查看>>