xinyu04

导航

2022年8月11日 #

MathProblem 4 Ant and spider problem

摘要: An ant and a blind spider are on opposite corners of a cube. The ant is stationary and the spider moves at random from one corner to another along the 阅读全文

posted @ 2022-08-11 17:29 Blackzxy 阅读(16) 评论(0) 推荐(0) 编辑

LeetCode 42 Trapping Rain Water 双指针+思维

摘要: Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. Soluti 阅读全文

posted @ 2022-08-11 16:42 Blackzxy 阅读(7) 评论(0) 推荐(0) 编辑

LeetCode 5 Longest Palindromic Substring

摘要: Given a string s, return the longest palindromic substring in s. Solution 求在 $s$ 中的最长回文字串。对于每一个位置,进行左右拓展,计算出长度并更新答案即可。 $Notes:$ 对于奇数或者偶数长度的字串,为了统一: 奇数 阅读全文

posted @ 2022-08-11 02:40 Blackzxy 阅读(13) 评论(0) 推荐(0) 编辑