当前位置: 首页 > news >正文

做网站的目标是什么学程序员需要什么基础

做网站的目标是什么,学程序员需要什么基础,wordpress商城主题开发,wordpress直播网站主题文章目录1. 题目2. 解题1. 题目 给定一个用字符串表示的整数的嵌套列表#xff0c;实现一个解析它的语法分析器。 列表中的每个元素只可能是整数或整数嵌套列表 提示#xff1a;你可以假定这些字符串都是格式良好的#xff1a; 字符串非空 字符串不包含空格 字符串只包含… 文章目录1. 题目2. 解题1. 题目 给定一个用字符串表示的整数的嵌套列表实现一个解析它的语法分析器。 列表中的每个元素只可能是整数或整数嵌套列表 提示你可以假定这些字符串都是格式良好的 字符串非空 字符串不包含空格 字符串只包含数字0-9、[、-、,、]示例 1 给定 s 324, 你应该返回一个 NestedInteger 对象其中只包含整数值 324。示例 2 给定 s [123,[456,[789]]], 返回一个 NestedInteger 对象包含一个有两个元素的嵌套列表1. 一个 integer 包含值 123 2. 一个包含两个元素的嵌套列表i. 一个 integer 包含值 456ii. 一个包含一个元素的嵌套列表a. 一个 integer 包含值 789来源力扣LeetCode 链接https://leetcode-cn.com/problems/mini-parser 著作权归领扣网络所有。商业转载请联系官方授权非商业转载请注明出处。 2. 解题 /*** // This is the interface that allows for creating nested lists.* // You should not implement it, or speculate about its implementation* class NestedInteger {* public:* // Constructor initializes an empty nested list.* NestedInteger();** // Constructor initializes a single integer.* NestedInteger(int value);** // Return true if this NestedInteger holds a single integer, rather than a nested list.* bool isInteger() const;** // Return the single integer that this NestedInteger holds, if it holds a single integer* // The result is undefined if this NestedInteger holds a nested list* int getInteger() const;** // Set this NestedInteger to hold a single integer.* void setInteger(int value);** // Set this NestedInteger to hold a nested list and adds a nested integer to it.* void add(const NestedInteger ni);** // Return the nested list that this NestedInteger holds, if it holds a nested list* // The result is undefined if this NestedInteger holds a single integer* const vectorNestedInteger getList() const;* };*/ class Solution { public:NestedInteger deserialize(string s) {if(s[0] ! [)return NestedInteger(stoi(s));stackNestedInteger stk;string num;for(int i 0; i s.size(); i){if(s[i] [)stk.push(NestedInteger());else if(isdigit(s[i]) || s[i]-){num s[i];}else // , ]{if(!num.empty()){stk.top().add(NestedInteger(stoi(num)));num.clear();}if(s[i]] stk.size()1){NestedInteger t stk.top();stk.pop();stk.top().add(t);}}}return stk.top();} };16 ms 11.2 MB C 我的CSDN博客地址 https://michael.blog.csdn.net/ 长按或扫码关注我的公众号Michael阿明一起加油、一起学习进步
http://www.zqtcl.cn/news/576685/

相关文章:

  • 中小企业网站建设行情嘉兴公司的网站设计
  • 做服装有哪些好的网站台州网站建设多少钱
  • 任县网站建设公司北京网站开发网站开发公司
  • 重庆seo网站策划网站的tdk指的是什么
  • 自做刷赞网站山东东成建设咨询有限公司网站
  • 泉州网站制作推广网站建设一年多少
  • 超大型网站建设公司网站打开显示建设中
  • 惠东县网站建设建设方案
  • 怎么把做的网站发布长春建网站
  • 织梦网站手机端郑州网站制作公司名单
  • 如何建设网站安全网站桥页也叫
  • 南浔网站建设昆山智能网站开发
  • 阿里云可以做电商网站吗杭州网站建设浙江
  • 查询网站备案进度网站建设推广
  • 怎么做公司网站需要什么科目高端网站建设教学
  • 资讯平台网站模板中企中立做的网站好吗
  • 网站开发人员配备山西省吕梁市简介
  • 网站注销主体注销中国建设教育协会培训报名网站
  • 电商网站设计思想建设化妆品网站的成本
  • 做房产网站能赚钱吗深圳龙华区邮政编码
  • 网站开发素材代码手机网站 win8风格
  • 免费推广网站软件班级网站怎么做ppt模板
  • 在线做任务的网站有哪些wordpress ui 插件
  • 竣工验收备案表查询网站优化大师win10能用吗
  • php 网站管理系统做生鲜管理系统的网站
  • 昆山建设工程招聘信息网站业绩显示屏 东莞网站建设技术支持
  • 百度我的网站广东广州网站建设
  • 怎么提高网站流量沈阳有资质做网站的公司有哪些
  • 内蒙古住房与城乡建设厅网站网址微信可以上网
  • 如何网站seo中国化工第九建设公司网站