摘要:
Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrenc 阅读全文
posted @ 2018-12-03 18:04
fatttcat
阅读(149)
评论(0)
推荐(0)
摘要:
Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the or 阅读全文
posted @ 2018-12-03 17:25
fatttcat
阅读(114)
评论(0)
推荐(0)
摘要:
Comparing Methods a.compareTo(b); //按字典顺序比较两个字符串,返回0: a=b, 返回正数: a > b, 返回负数: a < b Sorting Methods Arrays.sort(); //字母序优先于长度Collections.sort(); Custo 阅读全文
posted @ 2018-12-03 15:04
fatttcat
阅读(209)
评论(0)
推荐(0)
摘要:
Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) Yo 阅读全文
posted @ 2018-12-03 14:55
fatttcat
阅读(138)
评论(0)
推荐(0)
摘要:
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2018-12-03 14:12
fatttcat
阅读(123)
评论(0)
推荐(0)
摘要:
Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra spa 阅读全文
posted @ 2018-12-03 13:45
fatttcat
阅读(138)
评论(0)
推荐(0)
摘要:
Given two arrays, write a function to compute their intersection. Example 1: Example 2: Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4] Output: [4,9] Exam 阅读全文
posted @ 2018-12-03 13:27
fatttcat
阅读(111)
评论(0)
推荐(0)
摘要:
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex 阅读全文
posted @ 2018-12-03 12:27
fatttcat
阅读(105)
评论(0)
推荐(0)
浙公网安备 33010602011771号