上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 37 下一页
摘要: Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get. 阅读全文
posted @ 2017-11-08 11:26 immjc 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the  阅读全文
posted @ 2017-11-07 10:12 immjc 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Given a list of strings words representing an English Dictionary, find the longest word in words that can be built one character at a time by other wo 阅读全文
posted @ 2017-11-06 17:43 immjc 阅读(228) 评论(0) 推荐(0) 编辑
摘要: Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2- 阅读全文
posted @ 2017-11-03 16:52 immjc 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 -- 阅读全文
posted @ 2017-11-03 15:58 immjc 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the roo 阅读全文
posted @ 2017-11-03 15:11 immjc 阅读(337) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list, determine if it is a palindrome. Follow up:Could you do it in O(n) time and O(1) space? 判断回文链表 思路:由于链表无法像数组、字符串一样直接定位到中间索引 阅读全文
posted @ 2017-11-03 11:26 immjc 阅读(96) 评论(0) 推荐(0) 编辑
摘要: Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100". 从低位到高位模拟二进制相加,如果相加结果产生进位,则对该数对2取余将结果放去结果st 阅读全文
posted @ 2017-11-03 10:21 immjc 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. to 阅读全文
posted @ 2017-11-02 21:47 immjc 阅读(112) 评论(0) 推荐(0) 编辑
摘要: Given an array of characters, compress it in-place. The length after compression must always be smaller than or equal to the original array. Every ele 阅读全文
posted @ 2017-10-31 17:22 immjc 阅读(277) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 37 下一页