上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 76 下一页
摘要: Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's 阅读全文
posted @ 2018-10-18 11:23 bernieloveslife 阅读(74) 评论(0) 推荐(0)
摘要: Shuffle a set of numbers without duplicates. Example: // Init an array with set 1, 2, and 3. int[] nums = {1,2,3}; Solution solution = new Solution(nu 阅读全文
posted @ 2018-10-18 11:23 bernieloveslife 阅读(163) 评论(0) 推荐(0)
摘要: Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l] is zero. To make pro 阅读全文
posted @ 2018-10-18 11:23 bernieloveslife 阅读(115) 评论(0) 推荐(0)
摘要: 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 ver 阅读全文
posted @ 2018-10-17 15:51 bernieloveslife 阅读(163) 评论(0) 推荐(0)
摘要: Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating 阅读全文
posted @ 2018-10-17 15:50 bernieloveslife 阅读(125) 评论(0) 推荐(0)
摘要: A string S of lowercase letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one p 阅读全文
posted @ 2018-10-17 15:50 bernieloveslife 阅读(150) 评论(0) 推荐(0)
摘要: You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1' 阅读全文
posted @ 2018-10-17 15:50 bernieloveslife 阅读(84) 评论(0) 推荐(0)
摘要: A matrix is Toeplitz if every diagonal from top left to bottom right has the same element. Now given an M x N matrix, return True if and only if the m 阅读全文
posted @ 2018-10-17 15:50 bernieloveslife 阅读(146) 评论(0) 推荐(0)
摘要: Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and ' '. '?' Matches any single character. ' ' M 阅读全文
posted @ 2018-10-16 10:58 bernieloveslife 阅读(679) 评论(0) 推荐(0)
摘要: Write a program to solve a Sudoku puzzle by filling the empty cells. A sudoku solution must satisfy all of the following rules: 1. Each of the digits 阅读全文
posted @ 2018-10-16 10:58 bernieloveslife 阅读(180) 评论(0) 推荐(0)
上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 76 下一页