wasPrime
  • Home
  • Archives
  • Categories
  • Tags
  • About

Introduction to C++20 Coroutines - Part 2 co_await/co_return

This series is related to C++20 coroutine.part 1: Generatorpart 2: co_await/co_returnpart 3: Some tips about life cycle when using coroutinespart 4: Some examples about co_awaitpart
2023-04-23
dev > cpp > stl > coroutine
#cpp #cpp20 #stl #coroutine

Negotiate Reasonable Groups

Problem DescriptionThis problem is from Zhihu https://www.zhihu.com/question/596919226 Write a program to find a reasonable answer. Assume there is a meeting and there are 5 possible studunts as atte
2023-04-22
system_design
#system_design

LeetCode 9 - Palindrome Number

Difficulty: easy Problem DescriptionEnglish (Palindrome Number)Given an integer x, return true if x is a palindrome, and false otherwise. Example 1: 123Input: x = 121Output: t
2023-04-21
algorithm > leetcode > mathematical
#algorithm #leetcode #mathematical #easy

LeetCode 5 - Longest Palindromic Substring

Difficulty: medium Problem DescriptionEnglish (Longest Palindromic Substring)Given a string s, return the longest palindromic substring in s. Example 1: 123Input: s = "ba
2023-04-20
algorithm > leetcode > dynamic_programming
#algorithm #leetcode #medium #dynamic_programming #dp

LeetCode 53 - Maximum Subarray

Difficulty: medium Problem DescriptionEnglish (Maximum Subarray)Given an integer array nums, find the subarray with the largest sum, and return its sum. Example 1: 123Input: n
2023-04-19
algorithm > leetcode > dynamic_programming
#algorithm #leetcode #medium #dynamic_programming #dp

LeetCode 239 - Sliding Window Maximum

Difficulty: hard Problem DescriptionEnglish (Sliding Window Maximum)You are given an array of integers nums, there is a sliding window of size k which is moving from the very
2023-04-18
algorithm > leetcode > sliding_window
#algorithm #sliding_window #leetcode #hard

LeetCode 146 - LRU Cache

Difficulty: medium Problem DescriptionEnglish (LRU Cache)Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. Implement the LRUCache clas
2023-04-17
algorithm > leetcode > linked_list
#algorithm #leetcode #linked_list #hashmap #medium

LeetCode 42 - Trapping Rain Water

Difficulty: hard Problem DescriptionEnglish (Trapping Rain Water)Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much
2023-04-16
algorithm > leetcode > greedy_algorithm
#algorithm #greedy_algorithm #leetcode #hard

unused variable when using std::views::iota in C++20

BackgroundIn traditional C++, we used to use an integer to make an iteration as below: 123for (auto i = begin; i < end; ++i) { ...} However, this way looks verbose. We potentially nee
2023-04-15
dev > cpp > stl
#cpp #cpp20 #stl #ranges #maybe_unused

LeetCode 23 - Merge k Sorted Lists

Difficulty: hard Problem DescriptionEnglish (Merge k Sorted Lists)You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the
2023-04-14
algorithm > leetcode > linked_list
#algorithm #leetcode #linked_list #priority_queue #heap #hard
1…56789

Search

Hexo Fluid