自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

不想做菜鸟的小螃蟹

菜鸟成长记录,欢迎批评指正

  • 博客(36)
  • 收藏
  • 关注

原创 【微信小程序】wx.request出现undefined

偶现,天啦噜,一直困惑了很久的bug终于找到原因了。示例代码如下wx.request({ sucess:function(res){ if(res.statusCode==200 && res.data.status==200){ //do something }else { console.lo...

2018-03-30 21:26:10 12271 1

原创 【Leetcode】645. Set Mismatch(Easy)

1.题目The set S originally contains numbers from 1 to n. But unfortunately, due to the data error, one of the numbers in the set got duplicated to another number in the set, which results in repetition ...

2018-03-29 11:02:49 467

原创 【Leetcode】643. Maximum Average Subarray I(Easy)

1.题目Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximum average value. And you need to output the maximum average value.Example 1:Input: [1,12,...

2018-03-29 10:44:45 202

原创 【Leetcode】637. Average of Levels in Binary Tree(Easy)

1.题目Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array.Example 1:Input: 3 / \ 9 20 / \ 15 7Output: [3, 14.5, 11]Explanatio...

2018-03-29 10:36:09 209

原创 【Android】fragment切换的demo

1.文件准备:①MainActivity.java activity_layout.xml;②3-4个Fragmentxx.java   fragmentxx.xml;③一个颜色资源文件,用于按钮切换的展示。④style文件,同一管理按钮的样式。2.MainActivitypublic class MainActivity extends AppCompatActivity { priv...

2018-03-28 11:43:41 1092

原创 【Leetcode】633. Sum of Square Numbers(Easy)

1.题目Given a non-negative integer c, your task is to decide whether there're two integers a and b such that a2 + b2 = c.翻译:给定一个非负整数 c ,你的任务是判断是否有两个整数 a 和 b ,使得a2 + b2 = c.Example 1:Input: 5Output: Tru...

2018-03-28 10:59:22 246

原创 【Leetcode】628. Maximum Product of Three Numbers(Easy)

1.题目Given an integer array, find three numbers whose product is maximum and output the maximum product.翻译:给定一个整数序列,找到三个数使得它们的乘积最大,并且输出最大的乘积。Example 1:Input: [1,2,3]Output: 6Example 2:Input: [1,2,3,4...

2018-03-28 10:50:52 306

原创 【Leetcode】627. Swap Salary(Easy)

1.题目Given a table salary, such as the one below, that has m=male and f=female values. Swap all f and m values (i.e., change all f values to m and vice versa) with a single update query and no intermed...

2018-03-28 10:44:36 268

原创 【Leetcode】620. Not Boring Movies(Easy)

1.题目X city opened a new cinema, many people would like to go to this cinema. The cinema also gives out a poster indicating the movies’ ratings and descriptions.Please write a SQL query to output movie...

2018-03-28 10:38:17 278

原创 【Leetcode】617. Merge Two Binary Trees(Easy)

1.题目Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.You need to merge them into a new binary tr...

2018-03-28 10:31:48 169

原创 【Leetcode】606. Construct String from Binary Tree(Easy)

1.题目You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way.The null node needs to be represented by empty parenthesis pair "()". And yo...

2018-03-27 10:17:45 195

原创 【Leetcode】605. Can Place Flowers(Easy)

1.题目Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cannot be planted in adjacent plots - they would compete for water and both would die.Gi...

2018-03-27 10:10:16 420

原创 【Leetcode】596. Classes More Than 5 Students(Easy)

1.题目There is a table courses with columns: student and classPlease list out all classes which have more than or equal to 5 students.For example, the table:+---------+------------+| student | class ...

2018-03-23 15:55:52 246

原创 【Leetcode】599. Minimum Index Sum of Two Lists(Easy)

1.题目Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings.You need to help them find out their common interest with th...

2018-03-23 15:50:20 212

原创 【微信小程序】设置合法域名

1.微信小程序开发的时候遇到的问题。xxx.xxx不在以下request合法域名列表中2.两种解决方案,在开发阶段我们可以在 小程序开发环境 右上角,点击“详情”,勾选“不校验安全域名。。。”3.要审核时等,进入微信公众平台(https://mp.weixin.qq.com),用小程序账号密码邮箱登录。在设置-开发设置-服务器域名 中进行设置。...

2018-03-23 10:22:02 11984

原创 【Leetcode】595. Big Countries(Easy)

1.题目There is a table World+-----------------+------------+------------+--------------+---------------+| name | continent | area | population | gdp |+-----------------+-...

2018-03-22 11:20:40 249

原创 【Leetcode】598. Range Addition II(Easy)

1.题目Given an m * n matrix M initialized with all 0's and several update operations.Operations are represented by a 2D array, and each operation is represented by an array with two positive integers a ...

2018-03-22 11:03:41 184

原创 【微信小程序】TextArea的坑

今天遇到一个textArea的坑,先上个图。1.点击“选择内容反馈”,弹出action-sheet时,有时点击第一个条目“讲太快”,textArea会把焦点劫走。2.解决方法,当actionsheet显示时,设置textarea的disabled属性为true. 即将textarea的disabled属性置为action-sheet的hiddden属性的取反值。...

2018-03-21 12:30:32 5521

原创 【Leetcode】594. Longest Harmonious Subsequence (Easy)

1.题目We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly 1.Now, given an integer array, you need to find the length of its longest h...

2018-03-21 12:25:19 205

原创 【Leetcode】581. Shortest Unsorted Continuous Subarray(Easy)

1.题目Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order, too.You need to fin...

2018-03-20 10:25:56 189

原创 【Leetcode】575. Distribute Candies(Easy)

1.题目Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of the corresponding kind. You need to dist

2018-03-20 10:07:10 163

原创 【Android】Volley的使用 获取数据+访问图片

1.内容学习自郭霖老师的博客 http://blog.csdn.net/guolin_blog/article/details/17482095最近刚买了第二行代码~想当初就是第一行代码带我学习android的~2.首先需要下载一个Volley.jar或者自己打包也行。下载地址郭霖老师博客有~下载之后防到libs目录下,重新开启Android Studio.3.新建一个class文件,继承自App...

2018-03-19 11:33:42 385

原创 【Android】EditText下拉菜单ListPopupWindow

demo里面默认了三个没规律的用户名,产品觉得输入太麻烦了,让做个下拉列表,选择。样式如下~①xml文件,中需要下拉菜单的EditText<EditText android:id="@+id/login_id" android:layout_width="0dp" android:layout_h...

2018-03-19 11:14:17 5340 1

原创 【Android】原生Progress提示

1.需求:在上传图片等一些耗时操作,长时间未收到服务器响应,应对用户进行等待提醒,防止用户多次操作。我们可以使用android原生的ProgressDialog进行实现。①首先声明一个ProgressDialogprivate ProgressDialog progressDialog;②用ProgressDialog.show(...)来进行信息设置,有几种参数不同的show方法。Progres...

2018-03-19 10:19:54 469

原创 【Android】简单dialog的使用

final AlertDialog.Builder builder = new AlertDialog.Builder(HomeActivity.this); builder.setTitle("更改用户吗?").setPositiveButton("是的", new DialogInterface.OnClickListener() { ...

2018-03-13 17:00:26 400

原创 【Android】从相册读取一个图片设置到ImageView中

昨晚遇到一个问题,从相册里选择一个图片展示到ImageView上,一直没反应。1.点击按钮发起跳转Intent i = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);startActivityForResult(i, RESULT_PICK_IMAGE);2...

2018-03-13 16:27:56 2245 2

原创 【Android】之ListView的使用

需求:在fragment中写入几个listview.,先看下效果图。这里的照片我写的是固定值,可置为不同照片。1.编写fragment的布局文件fragment_hat,插入<ListView>标签.(此处MyListView是继承自ListView,稍后说明)<LinearLayout xmlns:android="http://schemas.android.com/apk/...

2018-03-13 15:32:45 336

原创 【Leetcode】572. Subtree of Another Tree(Easy)

1.题目Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a tree consists of a node in s and all of this ...

2018-03-09 11:33:46 205

原创 【Leetcode】566. Reshape the Matrix(Easy)

1.题目In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different size but keep its original data.You're given a matrix represented by a two-dim...

2018-03-09 11:27:09 183

原创 【Leetcode】563. Binary Tree Tilt(Easy)

1.题目Given a binary tree, return the tilt of the whole tree.The tilt of a tree node is defined as the absolute difference between the sum of all left subtree node values and the sum of all right subtre...

2018-03-08 11:01:47 200

原创 【Leetcode】561. Array Partition I(Easy)

1.题目Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as ...

2018-03-07 11:24:00 617

原创 【Leetcode】557. Reverse Words in a String III (Easy)

1.题目Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.Example 1:Input: "Let's take LeetCode contest"O...

2018-03-07 10:31:49 203

原创 【Leetcode】551. Student Attendance Record I(Easy)

1.题目You are given a string representing an attendance record for a student. The record only contains the following three characters:'A' : Absent.'L' : Late.'P' : Present.A student could be rewarded if...

2018-03-06 10:42:24 198

原创 【Leetcode】543. Diameter of Binary Tree(Easy)

1.题目Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may or m...

2018-03-06 10:32:28 273

原创 【Leetcode】541. Reverse String II(Easy)

1.题目Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If there are less than k characters left, reverse all of ...

2018-03-05 13:59:56 221

原创 【Leetcode】538. Convert BST to Greater Tree(Easy)

1.题目Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all keys greater than the original key in BST.Exam...

2018-03-05 13:33:32 246

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除