首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
首页
>
试题广场
>
加一
[编程题]加一
热度指数:12983
时间限制:C/C++ 1秒,其他语言2秒
空间限制:C/C++ 32M,其他语言64M
算法知识视频讲解
给出用数字数组表示的
一个
非负整数
,请对该整数加1。
示例1
输入
[1]
输出
[2]
示例2
输入
[1,2,3]
输出
[1,2,4]
马上挑战
算法知识视频讲解
提交运行
算法知识视频讲解
添加笔记
求解答(0)
邀请回答
收藏(39)
分享
提交结果有问题?
0个回答
3篇题解
添加回答
这道题你会答吗?花几分钟告诉大家答案吧!
提交观点
问题信息
数组
难度:
0条回答
39收藏
27797浏览
热门推荐
通过挑战的用户
查看代码
这一世
2022-12-08 07:31:51
球球了2023...
2022-10-11 00:46:36
牛客93929...
2022-10-10 15:57:19
牛客1891197号
2022-10-01 15:56:20
forwgzz
2022-09-21 20:45:38
相关试题
下列表达式中,不合法的是() 已知...
Java
评论
(1)
来自
迅雷2013C++笔试卷B
假设动态表的扩张和收缩策略为:&a...
高级算法
评论
(1)
吐泡泡
栈
评论
(2)
好串
栈
过关题目
评论
(1)
约瑟夫环
过关题目
语言题
评论
(1)
加一
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题
import java.util.*; public class Solution { /** * * @param digits int整型一维数组 * @return int整型一维数组 */ public int[] plusOne (int[] digits) { // write code here } }
class Solution { public: /** * * @param digits int整型vector * @return int整型vector */ vector
plusOne(vector
& digits) { // write code here } };
# # # @param digits int整型一维数组 # @return int整型一维数组 # class Solution: def plusOne(self , digits ): # write code here
/** * * @param digits int整型一维数组 * @return int整型一维数组 */ function plusOne( digits ) { // write code here } module.exports = { plusOne : plusOne };
# # # @param digits int整型一维数组 # @return int整型一维数组 # class Solution: def plusOne(self , digits ): # write code here
package main /** * * @param digits int整型一维数组 * @return int整型一维数组 */ func plusOne( digits []int ) []int { // write code here }
[1]
[2]
[1,2,3]
[1,2,4]