useState is typically simpler at first than useReducer (you can even implement useState using useReducer), but there's one scenario where useReducer i ...
分类:
其他好文 时间:
2020-03-11 18:14:07
阅读次数:
69
原题链接在这里:https://leetcode.com/problems/product-of-the-last-k-numbers/ 题目: Implement the class ProductOfNumbers that supports two methods: 1. add(int nu ...
分类:
其他好文 时间:
2020-03-08 15:45:52
阅读次数:
64
Natas23: 一个登录页面,查看源码,发现关键代码: if(array_key_exists("passwd",$_REQUEST)){ if(strstr($_REQUEST["passwd"],"iloveyou") && ($_REQUEST["passwd"] > 10 )){ echo ...
分类:
Web程序 时间:
2020-03-06 23:54:59
阅读次数:
139
1 """ 2 Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. 3 get(key) ...
分类:
系统相关 时间:
2020-03-06 22:05:50
阅读次数:
100
std::string uint2string(const uint32_t value, int radix /*= 10*/) { std::string strString = ""; switch (radix) { case 10: strString = std::to_string(v ...
分类:
其他好文 时间:
2020-03-05 18:02:00
阅读次数:
84
用栈模拟队列。题干即是题意,用栈实现队列的几个函数,例子, Example: MyQueue queue = new MyQueue(); queue.push(1); queue.push(2); queue.peek(); // returns 1 queue.pop(); // returns ...
分类:
其他好文 时间:
2020-03-04 09:53:27
阅读次数:
58
Design and implement a TwoSum class. It should support the following operations: add and find. add - Add the number to an internal data structure.find ...
分类:
其他好文 时间:
2020-03-04 09:16:12
阅读次数:
75
1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-03-07 3 * Your MyQueue object will be instantiated and called ...
分类:
编程语言 时间:
2020-03-02 15:07:09
阅读次数:
68
1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-07 3 * Your MyStack object will be instantiated and called ...
分类:
编程语言 时间:
2020-03-02 14:58:48
阅读次数:
75
LeetCode#28 | Implement strStr() 实现strStr() ...
分类:
其他好文 时间:
2020-02-28 01:34:59
阅读次数:
76