首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
首页
>
试题广场
>
加一
[编程题]加一
热度指数:12922
时间限制:C/C++ 1秒,其他语言2秒
空间限制:C/C++ 32M,其他语言64M
算法知识视频讲解
给出用数字数组表示的
一个
非负整数
,请对该整数加1。
示例1
输入
[1]
输出
[2]
示例2
输入
[1,2,3]
输出
[1,2,4]
马上挑战
算法知识视频讲解
提交运行
算法知识视频讲解
添加笔记
求解答(0)
邀请回答
收藏(38)
分享
提交结果有问题?
0个回答
3篇题解
添加回答
这道题你会答吗?花几分钟告诉大家答案吧!
提交观点
问题信息
数组
难度:
0条回答
38收藏
26710浏览
热门推荐
通过挑战的用户
查看代码
这一世
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
相关试题
属于组合逻辑电路是()。
数字电路
评论
(1)
有同事不完成任务,影响力进度,你怎...
业务综合
评论
(1)
如果通过这次面试我们单位录用了你,...
岗位认知
自我认知
评论
(1)
请你说说Java的特点和优点,为什...
Java
评论
(267)
你身边有哪些人还没有使用滴滴,你认...
用户研究
评论
(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]