摘要: Given two arrays, write a function to compute their intersection. Example 1: Example 2: Note: Each element in the result should appear as many times a 阅读全文
posted @ 2018-12-03 21:20 bernieloveslife 阅读(139) 评论(0) 推荐(0)
摘要: Given a non empty integer array, find the minimum number of moves required to make all array elements equal, where a move is incrementing a selected e 阅读全文
posted @ 2018-12-03 17:10 bernieloveslife 阅读(124) 评论(0) 推荐(0)
摘要: There are two types of soup: type A and type B. Initially we have N ml of each type of soup. There are four kinds of operations: 1. Serve 100 ml of so 阅读全文
posted @ 2018-12-03 16:54 bernieloveslife 阅读(234) 评论(0) 推荐(0)
摘要: 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-12-03 14:20 bernieloveslife 阅读(196) 评论(0) 推荐(0)
摘要: Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum pro 阅读全文
posted @ 2018-12-03 13:28 bernieloveslife 阅读(150) 评论(0) 推荐(0)
摘要: Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a g 阅读全文
posted @ 2018-12-03 12:41 bernieloveslife 阅读(166) 评论(0) 推荐(0)