zem_nezer
码龄11年
关注
提问 私信
  • 博客:31,130
    31,130
    总访问量
  • 196
    原创
  • 1,426,023
    排名
  • 2
    粉丝
  • 0
    铁粉
IP属地以运营商信息为准,境内显示到省(区、市),境外显示到国家(地区)
IP 属地:美国
  • 加入CSDN时间: 2014-06-20
博客简介:

zem_nezer的博客

查看详细资料
个人成就
  • 获得9次点赞
  • 内容获得7次评论
  • 获得1次收藏
创作历程
  • 128篇
    2019年
  • 69篇
    2018年
  • 1篇
    2017年
成就勋章
TA的专栏
  • DNN
    1篇
  • ACM
    16篇
  • 算法
    185篇
创作活动更多

仓颉编程语言体验有奖征文

仓颉编程语言官网已上线,提供版本下载、在线运行、文档体验等功能。为鼓励更多开发者探索仓颉编程语言,现诚邀各位开发者通过官网在线体验/下载使用,参与仓颉体验有奖征文活动。

368人参与 去创作
  • 最近
  • 文章
  • 代码仓
  • 资源
  • 问答
  • 帖子
  • 视频
  • 课程
  • 关注/订阅/互动
  • 收藏
搜TA的内容
搜索 取消

leetcode-255-Verify Preorder Sequence in Binary Search Tree

cannot solve it. use the property of BST and preorder, which is the first element is the root of the tree, we can break it into 2 part, and the upper bound of left part is root, so as the lower bound ...
原创
发布博客 2019.04.02 ·
161 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leecode-773-Sliding Puzzle

cannot solve it. Simply use BFS, and use status compress to compress the tiles into a string, and use set to record it.
原创
发布博客 2019.04.02 ·
231 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode-29-Divide Two Integers

error: cannot solve it. pattern: check edge case: if up == INT_MIN, return INT_MAX if down == -1, INT_MIN if down == 1; convert up and down to positive integer every time use a variable to remember h...
原创
发布博客 2019.02.21 ·
204 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

973-K Closest Points to Origin

O(nlogk), use priority_queue to do this, create a max heap if(heap.size() < K or heap.top() > cur_dis), then update new data.
原创
发布博客 2019.02.21 ·
262 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode-348-Design Tic-Tac-Toe

error: do not know what is move means, use row array, col array, diag, anti_diag to record current situation. Assign 1 if player is 1, and -1 if player is 2
原创
发布博客 2019.02.21 ·
207 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode-583-Delete Operation for Two Strings

error: cannot solve it. pattern: dp[i][j] = dp[i - 1][j - 1] + 1 (if s[i - 1] == p[j - 1]) dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) (if s[i - 1] != p[j - 1]) now cannot explain why dp[i][j] = dp[i ...
原创
发布博客 2019.02.21 ·
101 阅读 ·
2 点赞 ·
0 评论 ·
0 收藏

leetcode-329-Longest Increasing Path in a Matrix

error: cannot solve it. pattern: dfs(x, y) = max(1 + dfs(new_x, new_y)), where val[x][y] < val[new_x][new_y]. if(dp[x][y] != -1) return dp[x][y];
原创
发布博客 2019.02.21 ·
128 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode-162-Find Peak Element

error: cannot solve it. it is about two part of array, not two point, every time compare rightmost of left part and leftmost of right part, i.e. nums[mid] and nums[mid + 1]. If nums[mid] < nums[mid...
原创
发布博客 2019.02.18 ·
153 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode-560-Subarray Sum Equals K

error: cannot solve it. assume T[i, j] = k, where T[i, j] is the sum of nums[i] to nums[j]. So the equations can transform to: S[j] - S[i - 1] = k. And if we know that preious the occurs of S[j] - k, ...
原创
发布博客 2019.02.18 ·
141 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode-426-Convert Binary Search Tree to Sorted Doubly Linked List

error: cannot solve it. use a previous node to store last inorder variable, then perform inroder traverse. pattern: inorder(root->left); prev->left = root; root->right = prev; ...
原创
发布博客 2019.02.18 ·
180 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode-109-Convert Sorted List to Binary Search Tree

error: cannot solve it. pattern: left open, right close for current search range convert(head, tail): if(head == tail) return nullptr; mid = find(head, tail); TreeNode *tree_mid = new TreeNo...
原创
发布博客 2019.02.18 ·
107 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode-114-Flatten Binary Tree to Linked List

error: cannot slove it. recursive call flatten(root->left), flatten(root->right) get the rightmost of root->left append root->right to rightmost of root->left assign root->left = nu...
原创
发布博客 2019.02.18 ·
138 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

Calculate IoU(intersection over union)

assume for each coordinate: {x1, y1}: lower left, {x2, y2}: upper right inter_x1 = max(x1, x1) inter_y1 = max(y1, y1) inter_x2 = min(x2, x2) inter_y2 = min(y2, y2) then we can calculate the intersecti...
原创
发布博客 2019.02.17 ·
396 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode-295-Find Median from Data Stream

error: cannot slove it. Use two heap, first the keep store left half and other for right heap. And 0 <= |left.size() - right| <= 1. If violent the rule, move to top number to other side. If cu...
原创
发布博客 2019.02.16 ·
195 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode-44-Wildcard Matching

error: use dp equation: dp[i][j]: whether string s of first i characters is match with string p of first j characters initial: dp[0][0] = true; dp[0][j] = dp[0][j - 1] (if p[j - 1] == '*') transfo...
原创
发布博客 2019.02.16 ·
154 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode-221-Maximal Square

error: do not want to coding ANYMORE!!! compute the matrix from (0, 0) to (x, y), then get the matrix sums[][]. for each point (x, y), compute its possible square, i.e., square from (x, y) to (x + di...
原创
发布博客 2019.02.15 ·
133 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode-410-Split Array Largest Sum

error: use equation: dp[i][j] = min(max(sums[i] - sums[k], dp[k][j - 1])), where dp[i][j] means the min. number divide 0-i into j group. if(j == 1) -> dp[i][j] = sums[i]; if(i < j) -> no solu...
原创
发布博客 2019.02.15 ·
239 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode-714-Best Time to Buy and Sell Stock with Transaction Fee

error: use DP. In i-th day, we can buy or sell, so we have two status: buy[i] or sell[i]. Each stands for the max profit if we buy/sell. So: sell[i] = max(sell[i - 1], sell[i - 1] + prices[i] + fee) b...
原创
发布博客 2019.02.15 ·
94 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode-377-Combination Sum IV

error: cannot solve it. DP equation: dp[i] = sum(num + dp[i - num]), where num is a number of nums vector, dp[i] is the total solution of sum to i. Also, initial dp[0] = 1 So that we can use memorize ...
原创
发布博客 2019.02.15 ·
148 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

leetcode-380-Insert Delete GetRandom O(1)

Error: need to use hashtable + vector. Hashtable to check whether a element is in vector or not. And store the index of vector, i.e., key: val in vector, val: index in vector Vector is use to insert/d...
原创
发布博客 2019.02.15 ·
132 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏
加载更多