二叉树路径。题意是给一个二叉树,请输出从根节点遍历到每个最小的叶子节点的路径。例子 Example: Input: 1 / \ 2 3 \ 5 Output: ["1->2->5", "1->3"] Explanation: All root-to-leaf paths are: 1->2->5, ...
分类:
其他好文 时间:
2020-01-12 13:25:09
阅读次数:
71
Shuffle a set of numbers without duplicates. Example: // Init an array with set 1, 2, and 3. int[] nums = {1,2,3}; Solution solution = new Solution(nu ...
分类:
其他好文 时间:
2020-01-12 10:10:14
阅读次数:
101
题目: Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Input: "tree" Output: "eert" Explanation: 'e' appears ...
分类:
编程语言 时间:
2020-01-12 09:51:15
阅读次数:
93
二叉树层序遍历。题干既是题意。如下例子, For example:Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 return its level order traversal as: [ [3], [9,20], [1 ...
分类:
其他好文 时间:
2020-01-12 09:41:11
阅读次数:
54
1. Handling missing keys with setdefault import sys import re WORD_RE = re.compile('\w+') index = {} print(sys.argv) # Example 3-2 with open(sys.argv[ ...
分类:
其他好文 时间:
2020-01-12 09:40:44
阅读次数:
86
使用双指针来完成这道题 时间复杂度为O(N^2) package com.example.demo09; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Rand ...
分类:
编程语言 时间:
2020-01-11 20:49:34
阅读次数:
100
joda time 在开始学习jdk8.time之前,先接触一下joda time。 example: Java中日期时间的api Java8中的所有时间都是不可变的,确保了线程安全。 没有必要去研究源代码。会用就可以了。省下时间去学习更重要,更有价值的事情上。 Java8的回顾和复盘 总共50节课 ...
分类:
编程语言 时间:
2020-01-11 14:59:32
阅读次数:
143
Question: 关于设置了server.context path无效 设置了path的值无效 cause: 因为spring boot版本问题导致的!!现在用的比较新的版本在2.0以上!这教学是1.0 2.0之间的.server.servlet.context path=/example 应该这 ...
分类:
其他好文 时间:
2020-01-11 13:35:44
阅读次数:
256
1.在github中创建一个账号:https://github.com/join?source=header-home 2.下载并安装git:https://git-scm.com/downloads 3.安装成功后打开Git Bash,输入下列命令,设置git全局用户名和邮箱 1 2 $ git ...
分类:
Web程序 时间:
2020-01-11 13:15:29
阅读次数:
90
一、Vue 在JavaScript中的声明 var example=new Vue( { el:'VueId', data: { item:{}, //声明单个对象 items:[], //声明集合 }, methods: { Add:function() { }, Edit:function(id ...
分类:
其他好文 时间:
2020-01-11 00:00:40
阅读次数:
79