摘要: Problem : Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number mu 阅读全文
posted @ 2020-03-29 23:18 littledy 阅读(77) 评论(0) 推荐(0)
摘要: Problem : Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non zero elements. Exampl 阅读全文
posted @ 2020-03-29 23:03 littledy 阅读(70) 评论(0) 推荐(0)
摘要: Problem : Given a singly linked list, determine if it is a palindrome. Example 1: Example 2: Follow up: Could you do it in O(n) time and O(1) space? 思 阅读全文
posted @ 2020-03-29 22:54 littledy 阅读(66) 评论(0) 推荐(0)
摘要: Problem : Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any posit 阅读全文
posted @ 2020-03-29 22:33 littledy 阅读(86) 评论(0) 推荐(0)
摘要: Problem : Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice 阅读全文
posted @ 2020-03-29 21:55 littledy 阅读(78) 评论(0) 推荐(0)
摘要: Problem : Given an array of size n, find the majority element. The majority element is the element that appears more than times. You may assume that t 阅读全文
posted @ 2020-03-29 16:47 littledy 阅读(68) 评论(0) 推荐(0)
摘要: Problem : 思路 : Solution (C++) : 性能 : Runtime: 932 ms Memory Usage: 14.8 MB 思路 : Solution (C++) : 性能 : Runtime: ms Memory Usage: MB 阅读全文
posted @ 2020-03-29 16:32 littledy 阅读(79) 评论(0) 推荐(0)