码迷,mamicode.com
首页 >  
搜索关键字:reverse integer    ( 19410个结果)
二叉树中和为某一值的路径
题目描述 输入一颗二叉树的根节点和一个整数,打印出二叉树中结点值的和为输入整数的所有路径。路径定义为从树的根结点开始往下一直到叶结点所经过的结点形成一条路径。(注意: 在返回值的list中,数组长度大的数组靠前) 题目详解 find(root.left,target,res,new ArrayLis ...
分类:其他好文   时间:2020-03-20 13:10:47    阅读次数:68
Map根据value值进行分组
今天碰到同事在群里问怎么把一个Map根据value进行分组,当时我的第一想法是将value和key互换,多个value对应的不同key作为集合,代码如下:12Map<String,Integer>SataMap=new HashMap<>(); final Map<Integer, List<Str ...
分类:其他好文   时间:2020-03-20 11:07:50    阅读次数:166
PTA(Advanced Level)1015.Reversible Primes
A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a re ...
分类:其他好文   时间:2020-03-19 22:04:02    阅读次数:72
PAT 1048数字加密
本题要求实现一种数字加密方法。首先固定一个加密用正整数 A,对任一正整数 B,将其每 1 位数字与 A 的对应位置上的数字进行以下运算:对奇数位,对应位的数字相加后对 13 取余——这里用 J 代表 10、Q 代表 11、K 代表 12;对偶数位,用 B 的数字减去 A 的数字,若结果为负数,则再加 ...
分类:其他好文   时间:2020-03-19 21:54:29    阅读次数:56
java代码获取当前时间是本周、本月、本年的第几天
public static void getWeekMonthYear(){ Map<String, Integer> mapInt = new LinkedHashMap<String, Integer>(); Calendar calendar = Calendar.getInstance(); ...
分类:编程语言   时间:2020-03-19 21:26:29    阅读次数:51
红包算法JAVA
//参数 peo 人数及红包个数 men public static void start(int peo,int men) { int min = 1;//低保 int mon_g;//分配后剩余的钱 Random rand = new Random(); List<Integer> list = ...
分类:编程语言   时间:2020-03-19 20:12:05    阅读次数:75
C语言习题【8】字符串逆序(递归实现)
编写一个函数reverse_string(char*string)(递归实现)实现:将参数字符串中的字符反向排列。要求:不能使用C函数库中的字符串操作函数。#include<stdio.h>intreverse_string(char*string){if(*string==‘\0‘){return0;}reverse_string(string+1);printf("%c",*str
分类:编程语言   时间:2020-03-19 09:30:43    阅读次数:66
[LeetCode] 273. Integer to English Words
整数转换英文表示。题意是给一个整数,请转换成英文表示。例子, Example 1: Input: 123 Output: "One Hundred Twenty Three" Example 2: Input: 12345 Output: "Twelve Thousand Three Hundred ...
分类:其他好文   时间:2020-03-19 09:30:00    阅读次数:67
LeetCode 7 Reverse Integer
题目: Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example 3: Inpu ...
分类:其他好文   时间:2020-03-18 23:36:39    阅读次数:72
基于线程开发一个FTP服务器
一,项目题目:基于线程开发一个FTP服务器 二,项目要求: 基本要求: 1.用户加密认证 2.允许同时多用户登录 3.每个用户有自己的家目录 ,且只能访问自己的家目录 4.对用户进行磁盘配额,每个用户的可用空间不同 5.允许用户在ftp server上随意切换目录 6.允许用户查看当前目录下文件 7 ...
分类:编程语言   时间:2020-03-18 23:31:24    阅读次数:76
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!