2018年8月28日

791. Custom Sort String

摘要: 感觉自己的答案比较intuitive S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was sorted in some custom order previou 阅读全文

posted @ 2018-08-28 21:30 猪猪🐷 阅读(128) 评论(0) 推荐(0)

What is the best way to memorize or remember what you study/read?

摘要: What is the best way to memorize or remember what you study/read? Rohit Malshe, Chem Engineer, Programmer, Amazon research scientist Updated Feb 15, 2 阅读全文

posted @ 2018-08-28 21:28 猪猪🐷 阅读(284) 评论(0) 推荐(0)

498. Diagonal Traverse

摘要: Example: 阅读全文

posted @ 2018-08-28 21:26 猪猪🐷 阅读(106) 评论(0) 推荐(0)

11. Container With Most Water

摘要: The above vertical lines are represented by array [1,8,6,2,5,4,8,3,7]. In this case, the max area of water (blue section) the container can contain is 阅读全文

posted @ 2018-08-28 21:24 猪猪🐷 阅读(109) 评论(0) 推荐(0)

Swap Nodes in Pairs

摘要: Given a linked list, swap every two adjacent nodes and return its head. Example: Note: Your algorithm should use only constant extra space. You may no 阅读全文

posted @ 2018-08-28 21:23 猪猪🐷 阅读(72) 评论(0) 推荐(0)

399. Evaluate Division

摘要: 399. Evaluate Division Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given some queries, return th... 阅读全文

posted @ 2018-08-28 21:19 猪猪🐷 阅读(118) 评论(0) 推荐(0)

360. Sort Transformed Array

摘要: Solution 1 didn’t use the list is sorted, use a min heap to put all the elements in and poll them from the top until the min heap is empty Solution 2 阅读全文

posted @ 2018-08-28 20:54 猪猪🐷 阅读(180) 评论(0) 推荐(0)

622. Design Circular Queue

摘要: Design your implementation of the circular queue. The circular queue is a linear data structure in which the operations are performed based on FIFO (F 阅读全文

posted @ 2018-08-28 20:53 猪猪🐷 阅读(209) 评论(0) 推荐(0)

8. String to Integer (atoi)

摘要: Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-white 阅读全文

posted @ 2018-08-28 20:50 猪猪🐷 阅读(158) 评论(0) 推荐(0)

886. Possible Bipartition

摘要: Given a set of N people (numbered 1, 2, ..., N), we would like to split everyone into two groups of anysize. Each person may dislike some other people 阅读全文

posted @ 2018-08-28 20:47 猪猪🐷 阅读(284) 评论(0) 推荐(0)

567. Permutation in String (return true if s2 contains the permutation of s1.)

摘要: Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's permutati 阅读全文

posted @ 2018-08-28 20:46 猪猪🐷 阅读(119) 评论(0) 推荐(0)

468. Validate IP Address

摘要: Write a function to check whether an input string is a valid IPv4 address or IPv6 address or neither. IPv4 addresses are canonically represented in do 阅读全文

posted @ 2018-08-28 20:45 猪猪🐷 阅读(135) 评论(0) 推荐(0)

708. Insert into a Cyclic Sorted List

摘要: Given a node from a cyclic linked list which is sorted in ascending order, write a function to insert a value into the list such that it remains a cyc 阅读全文

posted @ 2018-08-28 20:44 猪猪🐷 阅读(300) 评论(0) 推荐(0)

99. Recover Binary Search Tree

摘要: Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Example 1: Input: [1,3,null,null,2 阅读全文

posted @ 2018-08-28 20:43 猪猪🐷 阅读(134) 评论(0) 推荐(0)

681. Next Closest Time

摘要: 681. Next Closest Time Given a time represented in the format "HH:MM", form the next closest time by reusing the current digits. There is no limit on how many times a digit can be reused. You may as... 阅读全文

posted @ 2018-08-28 20:42 猪猪🐷 阅读(331) 评论(0) 推荐(0)

Constructor

摘要: Constructor https://www.dummies.com/programming/java/how-to-use-a-constructor-in-java/ 阅读全文

posted @ 2018-08-28 20:41 猪猪🐷 阅读(110) 评论(0) 推荐(0)

Integer to Roman

摘要: Idea : remove the biggest value as I can , That’s == 0 or > 0, then append the string representation while(value > 0){ if(value - values[i] >= 0){ num 阅读全文

posted @ 2018-08-28 20:40 猪猪🐷 阅读(108) 评论(0) 推荐(0)

13. Roman to Integer

摘要: The indexOf(String target) method searches left-to-right inside the given string for a "target" string. The indexOf() method returns the index number 阅读全文

posted @ 2018-08-28 20:39 猪猪🐷 阅读(106) 评论(0) 推荐(0)

862. Shortest Subarray with Sum at Least K

摘要: If there is no non-empty subarray with sum at least K, return -1. Example 1: Input: A = [1], K = 1 Output: 1 Example 2: Input: A = [1,2], K = 4 Output 阅读全文

posted @ 2018-08-28 20:19 猪猪🐷 阅读(347) 评论(0) 推荐(0)

437. Path Sum III

摘要: You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not need t 阅读全文

posted @ 2018-08-28 20:15 猪猪🐷 阅读(116) 评论(0) 推荐(0)

导航