摘要: Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of th 阅读全文
posted @ 2019-08-01 22:35 CodingYM 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Given an array A of positive lengths, return the largest perimeter of a triangle with non-zero area, formed from 3 of these lengths. If it is impossib 阅读全文
posted @ 2019-08-01 22:16 CodingYM 阅读(89) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int[] relativeSortArray(int[] arr1, int[] arr2) { int k = 0; int t = 0; int[] res = new int[arr1.length]; ... 阅读全文
posted @ 2019-08-01 17:26 CodingYM 阅读(85) 评论(0) 推荐(0) 编辑
摘要: import java.util.*; class Solution { public int[] intersection(int[] nums1, int[] nums2) { Set set1 = new HashSet(); int len = nums1.length> nums2.length? nums2.length:nums... 阅读全文
posted @ 2019-08-01 16:28 CodingYM 阅读(78) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int twoCitySchedCost(int[][] costs) { if(costs[0].length ==0||costs.length==0) return 0; int [] arr = new int[co... 阅读全文
posted @ 2019-08-01 13:13 CodingYM 阅读(140) 评论(0) 推荐(0) 编辑
摘要: class Solution { public boolean isRobotBounded(String instructions) { int len = instructions.length(); int x = 0; int y = 0; in... 阅读全文
posted @ 2019-08-01 10:16 CodingYM 阅读(150) 评论(0) 推荐(0) 编辑