48. Rotate Image
来源:互联网 发布:java session取不到值 编辑:程序博客网 时间:2024/06/08 07:46
class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
int len = matrix.size();
vector<vector<int> >res;
vector<int >temp;
for (int i = 0; i < len; i++)
{
for (int j = 0; j < len; j++)
{
temp.push_back(matrix[len - j-1][i]);
}
res.push_back(temp);
temp.clear();
}
for (int i = 0; i < len; i++)
{
for (int j = 0; j < len; j++)
{
matrix[i][j] = res[i][j];
}
}
}
};
0 0
- [LeetCode]48.Rotate Image
- LeetCode 48. Rotate Image
- LeetCode 48.Rotate Image
- LeetCode --- 48. Rotate Image
- [Leetcode] 48. Rotate Image
- 48. Rotate Image
- 48. Rotate Image
- 48. Rotate Image
- 48. Rotate Image
- [leetcode] 48. Rotate Image
- Leetcode 48. Rotate Image
- 48. Rotate Image LeetCode
- [LeetCode]48. Rotate Image
- 48. Rotate Image
- 48. Rotate Image
- leetcode 48. Rotate Image
- Leetcode 48. Rotate Image
- LeetCode 48. Rotate Image
- HandlerThread使用&源码解析
- 当Swoole遇上PHP
- 枣林村皇家理工学院的总结
- 慕课网c语言入门学习笔记(continue,switch,goto)
- 关于我——黄国攀
- 48. Rotate Image
- 数学和机器学习
- 对象序列化
- 表达式计算模板
- 通达OA二次开发 开发高级管理者批量签批流程及自动结束程序(图文)
- 周志华《Machine Learning》学习笔记(8)--贝叶斯分类器
- mrpt在win8.1 64bit + vs2013环境下的安装和编译
- jdbcTemplate模板和JdbcDaoSupport工具
- java 操作Redis string 命令 实例(Jedis) (二)