- 博客(7)
- 收藏
- 关注
原创 670. Maximum Swap
Given a non-negative integer, you could swap two digitsat mostonce to get the maximum valued number. Return the maximum valued number you could get旋转一个整数的两位数字 得到一个最大的数字2736-> 72369973思路:...
2019-10-11 10:22:24 90
原创 leetcode 973-----
这道题要求我们给定几个一维数组, 返回到(0,0) 点最近的距离的K个数组输入[1,3][-2,2] K=1 //我们需要得到一个到(0,0)点最小的距离的数组输出[-2,2]因为我们要维护一个大小为K 的最小堆,所以我们使用PriorityQueue 来实现,如果单纯使用PriorityQueue 中的元素根据坐标power求和排序,但是我们还需要这个sum所...
2019-08-22 06:11:09 179
原创 leetcode 449, 二叉树的复原
自己太菜了 , 反序列化还是看了答案才写出来好多次碰到复原二叉树的题目都不会做了, 写一下序列化一颗二叉树: 采用先序遍历法,将每个节点拼成一个String,比较简单反序列化一颗二叉树(还得看答案。。。。。好菜啊):10 8 7 9 |20 15 22首先第一个值肯定是root , 比root 大的第一个值是root.right, 比root小的第一个值是root...
2019-08-04 16:00:08 158
原创 378. Kth Smallest Element in a Sorted Matrix
Given anxnmatrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix.Note that it is the kth smallest element in the sorted order, not t...
2019-03-04 00:37:58 101
原创 Monggo DB 对键值名称的操作
修改Monggo DB 数据库 中某一个键值得名称db.test.update({},{$rename:{"formerKey":"latterKey"}},false,true);删除Monggo DB中某一个字段的名称db.User.update({},{$unset:{'key':' '}},false,true);
2018-01-23 15:38:13 1088
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人