首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
郭军
西安邮电大学
2019届
Java工程师
关注
私信
加入黑名单
举报TA
首页
刷题
圈子
项目
笔记
基本资料
真题试卷
在线编程
心理测试
回答的问题(43)
求1+2+3+...+n
0
public class Solution { public int Sum_Solution(int n) { int sum = (int) (Math.pow(n, 2) + n); return sum >> 1; } }
发表于 2018-05-26 15:36:07
扑克牌顺子
0
public class Solution { public boolean IsContinuous(int [] numbers) { if (numbers == null || numbers.length < 1) return fal...
发表于 2018-05-26 14:37:27
左旋转字符串
0
public class Solution { public String LeftRotateString(String str,int n) { if (str == null || str.length() < n) return new ...
发表于 2018-05-26 14:03:28
翻转单词序列
0
public class Solution { public String ReverseSentence(String str) { if (str == null) return null; if (str.trim().equal...
发表于 2018-05-26 13:50:48
和为S的连续正数序列
0
import java.util.ArrayList; public class Solution { public ArrayList<ArrayList<Integer> > FindContinuousSequence(int sum) { Ar...
发表于 2018-05-26 11:52:29
和为S的两个数字
0
import java.util.ArrayList; public class Solution { public ArrayList<Integer> FindNumbersWithSum(int [] array,int sum) { ArrayList&...
发表于 2018-05-26 11:19:47
数组中只出现一次的数字
0
//num1,num2分别为长度为1的数组。传出参数 //将num1[0],num2[0]设置为返回结果 public class Solution { public void FindNumsAppearOnce(int [] array,int num1[] , int num2[]) { i...
发表于 2018-05-26 10:31:22
两个链表的第一个公共结点
0
public class Solution { public ListNode FindFirstCommonNode(ListNode pHead1, ListNode pHead2) { //得到两个链表的长度 int aLength = getListL...
发表于 2018-05-25 15:58:01
第一个只出现一次的字符
0
import java.util.LinkedHashMap; import java.util.Map; public class Solution { public int FirstNotRepeatingChar(String str) { if (str == n...
发表于 2018-05-25 13:32:06
整数中1出现的次数(从1到n整数中1出现的次数)
0
public class Solution { public int NumberOf1Between1AndN_Solution(int n) { int times = 0; for (int i = 1; i <= n; i++) { ...
发表于 2018-05-24 21:49:33
首页
上一页
1
2
3
4
5
下一页
末页
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题