![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LEETCODE
无用理想家
废物一个
展开
-
[LEETCODE June Challenge] 04 Reverse String
Problem DescriptionWrite a function that reverses a string. The input string is given as an array of characters char[].Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.You may原创 2020-06-04 15:48:20 · 133 阅读 · 0 评论 -
[LEETCODE June Challenge] 03 Two City Scheduling
Problem DescriptionThere are 2N people a company is planning to interview. The cost of flying the i-th person to city A is costs[i][0], and the cost of flying the i-th person to city B is costs[i][1].Return the minimum cost to fly every person to a city原创 2020-06-04 13:11:55 · 115 阅读 · 0 评论 -
[LEETCODE June Challenge] 02 Delete Node in a Linked List
其实这次没太看懂题目啊 那个函数输入的是要删除的节点还是头节点啊好郁闷 就当作删除的节点来写了没想到ok的?(小声 啊数据结构这玩意真的该复习一波了orzProblem DescriptionWrite a function to delete a node (except the tail) in a singly linked list, given only access to that node./** * Definition for singly-linked list. * stru原创 2020-06-02 17:25:11 · 91 阅读 · 0 评论 -
[LEETCODE June Challenge] 01 Invert Binary Tree
<c艹复健期间 改用c艹刷leetcode>Invert Binary TreeProblem DescriptionSolution遍历树的话就前序遍历,先访问根节点再左子树然后右子树。对左右节点进行交换,就设一个中间量然后互换。(emmmmm好像没啥好说的就这样 void swap(TreeNode *curr) { if(!curr) return; swap(curr->left); swap(cu原创 2020-06-02 11:38:51 · 89 阅读 · 0 评论