IncredibleThings

导航

上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 28 下一页

2018年4月28日 #

Microsoft - Find the K closest points to the origin in a 2D plane

摘要: Find the K closest points to the origin in a 2D plane, given an array containing N points. 用 max heap 做 阅读全文

posted @ 2018-04-28 23:40 IncredibleThings 阅读(153) 评论(0) 推荐(0) 编辑

Microsoft - Get Course Order

摘要: // "static void main" must be defined in a public class. public class Main { public static void main(String[] args) { int[][] info = new int[4][]; info[0] = null; info[... 阅读全文

posted @ 2018-04-28 12:57 IncredibleThings 阅读(159) 评论(0) 推荐(0) 编辑

LeetCode - Sum of Two Integers

摘要: Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example:Given a = 1 and b = 2, return 3. 1、输入 a,b 2、按照 阅读全文

posted @ 2018-04-28 11:09 IncredibleThings 阅读(109) 评论(0) 推荐(0) 编辑

Microsoft - Find Biggest Node

摘要: public Node findBiggest (Node n1, Node n2){ Node c1 = n1; Node c2 = n2; boolean isPositive = false; if(n1.value == '-'){ if(n2.value != '-'){ return n2; ... 阅读全文

posted @ 2018-04-28 10:18 IncredibleThings 阅读(127) 评论(0) 推荐(0) 编辑

2018年4月25日 #

LeetCode - Valid Perfect Square

摘要: Given a positive integer num, write a function which returns True if num is a perfect square else False. Note: Do not use any built-in library functio 阅读全文

posted @ 2018-04-25 09:37 IncredibleThings 阅读(112) 评论(0) 推荐(0) 编辑

2018年4月24日 #

Range Sum Query - Immutable

摘要: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Note: num[i]存的是nums的前i-1个元素之和,反正前j个元素和减 阅读全文

posted @ 2018-04-24 10:04 IncredibleThings 阅读(105) 评论(0) 推荐(0) 编辑

LeetCode - Missing Number

摘要: Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1 Input: [3,0,1] Output: 阅读全文

posted @ 2018-04-24 09:33 IncredibleThings 阅读(92) 评论(0) 推荐(0) 编辑

2017年12月13日 #

LeetCode-Find the Difference

摘要: Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at 阅读全文

posted @ 2017-12-13 10:41 IncredibleThings 阅读(127) 评论(0) 推荐(0) 编辑

LeetCode-First Unique Character in a String

摘要: Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: s = "leetcode" return 0. 阅读全文

posted @ 2017-12-13 10:10 IncredibleThings 阅读(126) 评论(0) 推荐(0) 编辑

2017年12月12日 #

LeetCode-Ransom Note

摘要: Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the rans 阅读全文

posted @ 2017-12-12 12:04 IncredibleThings 阅读(105) 评论(0) 推荐(0) 编辑

上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 28 下一页