摘要:
Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Input: [1,2,3] Output: 6 Example 2: Inp 阅读全文
阅读排行榜
[LeetCode] 2863. Maximum Length of Semi-Decreasing Subarrays_Medium tag: stack
2023-10-12 04:56 by Johnson_强生仔仔, 190 阅读, 收藏,
摘要:
You are given an integer array nums. Return the length of the longest semi-decreasing subarray of nums, and 0 if there are no such subarrays. A subarr 阅读全文
[LeetCode] 146. LRU Cache_Hard tag: Hash, Linked List
2019-05-18 11:10 by Johnson_强生仔仔, 190 阅读, 收藏,
摘要:
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the 阅读全文
[Java in NetBeans] Lesson 08. If: conditional statement
2018-12-14 05:20 by Johnson_强生仔仔, 190 阅读, 收藏,
摘要:
这个课程的参考视频和图片来自youtube。 主要学到的知识点有: 1. If-else statement 2. Logical operators AND && OR || NOT ! 阅读全文
[LeetCode] 598. Range Addition II_Easy tag: Math
2018-08-27 23:48 by Johnson_强生仔仔, 190 阅读, 收藏,
摘要:
做个基本思路可以用 brute force, 但时间复杂度较高. 因为起始值都为0, 所以肯定是左上角的重合的最小的长方形就是结果, 所以我们求x, y 的最小值, 最后返回x*y. Code T: O(m*n) S: O(1) 阅读全文
浙公网安备 33010602011771号