
面试编程题
文章平均质量分 54
冬己ddung
这个作者很懒,什么都没留下…
展开
-
找出数组中重复的数字
在一个长度为n的数组里的所有数字都在0到n-1的范围内。 数组中某些数字是重复的,但不知道有几个数字是重复的。也不知道每个数字重复几次。请找出数组中任意一个重复的数字。 例如,如果输入长度为7的数组{2,3,1,0,2,5,3},那么对应的输出是第一个重复的数字2。package example3;import java.util.HashMap;public cl原创 2017-07-01 15:58:36 · 2201 阅读 · 0 评论 -
leetcode_Reverse Integer
问题描述:Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321The input is assumed to be a 32-bit signed integer. Your function should return 0 when the rever原创 2017-06-11 11:06:35 · 259 阅读 · 0 评论 -
leetcode_Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same原创 2017-06-09 10:39:28 · 240 阅读 · 0 评论 -
leetcode_Palindrome Number
问题描述:Determine whether an integer is a palindrome. Do this without extra space. 判断一个整数是不是回文数,并且不借助额外的空间解决思路:一个回文数反转之后还是它本身package com.main;package com.main;public class Palin原创 2017-06-11 11:45:43 · 212 阅读 · 0 评论 -
拼凑钱币
给你六种面额 1、5、10、20、50、100 元的纸币,假设每种币值的数量都足够多,编写程序求组成N元(N为0~10000的非负整数)的不同组合的个数。 输入描述:输入包括一个整数n(1 ≤ n ≤ 10000)输出描述:输出一个整数,表示不同的组合方案数输入例子:1输出例子:1import java.util.Scanner;import java原创 2017-06-26 19:50:18 · 1589 阅读 · 0 评论 -
大富翁游戏
大富翁游戏,玩家根据骰子的点数决定走的步数,即骰子点数为1时可以走一步,点数为2时可以走两步,点数为n时可以走n步。求玩家走到第n步(nimport java.util.Scanner;public class Conclusion { /** * @param args */ public static int getConclusion(int n){原创 2017-06-26 19:52:30 · 1195 阅读 · 0 评论 -
TF-IDF
# -*- coding:utf-8 -*-__author__ = "dongluyu"from sklearn.feature_extraction.text import TfidfTransformerfrom sklearn.feature_extraction.text import CountVectorizerif __name__ == "__main__":原创 2017-06-14 18:34:20 · 330 阅读 · 0 评论