原创 leetcode【204】【tag Math】Count Primes【c++版本,改進的素數表法】

問題描述: Count the number of prime numbers less than a non-negative number, n. Example: Input: 10 Output: 4 Explanation:

原创 leetcode【231】【tag Math】Power of Two【c++版本,多種解法,時間100%】

問題描述: Given an integer, write a function to determine if it is a power of two. Example 1: Input: 1 Output: true Expla

原创 leetcode【222】【tag Tree】Count Complete Tree Nodes【c++版本,多種解法】

問題描述: Share Given a complete binary tree, count the number of nodes. Note: Definition of a complete binary tree from Wi

原创 leetcode【202】【tag Math】Happy Number【c++版本,時間100%】

問題描述: Write an algorithm to determine if a number n is "happy". A happy number is a number defined by the following pro

原创 Key Spotting 小總結【關鍵詞搜索】【大部分源於interspeech和ICASSP】

最近轉了方向,就看了一些NLP方面的文章,這裏做的小總結 目錄 A survey on structured discriminative spoken keyword spotting SMALL-FOOTPRINT KEYWORD S

原创 leetcode【312】Burst Balloons【c++版本,時間81%】

問題描述: Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. Y

原创 leetcode【153,154】【tag array】Find Minimum in Rotated Sorted Array I / II【c++版本,二分查找,劍指offer,遞歸,非常簡潔】

問題描述(153): Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e.,  [0,1,

原创 leetcode【309】Best Time to Buy and Sell Stock with Cooldown【c++版本,時間100%,空間O(1)】

問題描述: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to fi

原创 leetcode【300】【tag DP Binary Search】Longest Increasing Subsequence【c++版本,時間95%,二分查找】

問題描述: Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Input: [10,9,2,

原创 leetcode【213】【tag DP】House Robber II【c++版本,時間O(n),空間O(1)】

問題描述: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money sta

原创 leetcode【289】【tag Array】Game of Life【c++版本,時間100%,空間O(1)】

問題描述: According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devis

原创 leetcode【287】【tag Array Two pointers】Find the Duplicate Number【c++版本,時間89%,兩種解法】

問題描述: Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at le

原创 leetcode【229】【tag Array】Majority Element II【c++版本,時間O(n)超越76%】

問題描述: Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Note: The algorithm shou

原创 leetcode【238】【tag Array】Product of Array Except Self【c++版本,多種解法】

問題描述: Given an array nums of n integers where n > 1,  return an array output such that output[i] is equal to the produc

原创 leetcode【228】【tag Array】Summary Ranges【c++版本,時間100%,有截圖】

問題描述: Given a sorted integer array without duplicates, return the summary of its ranges. Example 1: Input: [0,1,2,4,5