c# 算法及数据结构每日练习记录_4
1.
https://leetcode.cn/problems/reverse-string/?envType=study-plan&id=suan-fa-ru-men&plan=algorithms&plan_progress=b48xitv
编写一个函数,其作用是将输入的字符串反转过来。输入字符串以字符数组 s
的形式给出。
修改输入数组、使用 O(1) 的额外空间解决这一问题
2.
https://leetcode.cn/problems/reverse-words-in-a-string-iii/description/?envType=study-plan&id=suan-fa-ru-men&plan=algorithms&plan_progress=b48xitv&orderBy=most_votes
s
1.
https://leetcode.cn/problems/reshape-the-matrix/description/?envType=study-plan&id=shu-ju-jie-gou-ru-men&plan=data-structures&plan_progress=b4tf6qe&orderBy=most_votes&languageTags=csharp
在 MATLAB 中,有一个非常有用的函数 reshape
,它可以将一个 m x n
矩阵重塑为另一个大小不同(r x c
给你一个由二维数组 mat
表示的 m x n
矩阵,以及两个正整数 r
和 c
,分别表示想要的重构的矩阵的行数和列数。
重构后的矩阵需要将原始矩阵的所有元素以相同的 行遍历顺序 填充。
如果具有给定参数的 reshape
操作是可行且合理的,则输出新的重塑矩阵;否则,输出原始矩阵
2.
https://leetcode.cn/problems/pascals-triangle/submissions/400723861/?envType=study-plan&id=shu-ju-jie-gou-ru-men&plan=data-structures&plan_progress=b4tf6qe&orderBy=most_votes
给定一个非负整数 numRows
,生成「杨辉三角」的前 行。
在「杨辉三角」中,每个数是它左上方和右上方的数的和