48. Rotate Image
来源:互联网 发布:互联网mysql开发规范 编辑:程序博客网 时间:2024/05/19 11:38
把一个图像旋转90度。要求不申请额外的空间
首先把每一行倒置,然后把对角线两边对称的交换。
class Solution {public: void rotate(vector<vector<int>>& matrix) { reverse(matrix.begin(), matrix.end()); for(int i = 0; i < matrix.size(); ++i){ for(int j = i + 1; j < matrix[0].size(); ++j){ swap(matrix[i][j], matrix[j][i]); } } }};
阅读全文
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
- 机器更了解人类?杜比实验室用生物传感器,理解人类观看视频反应
- NBA萌神库里代言vivo Xplay6广告大片出炉
- 世界黑客大赛中国夺冠 360荣获Pwn2Own2017总冠军
- 微软Azure云服务爆发全球性故障,持续9个小时
- 腾讯重拳打击网络违规,关停违规账号1300个
- 48. Rotate Image
- java spi实例
- 0.01元!腾讯云真的中标厦门政务云
- 143.Reorder List
- 如何编写智能合约(Smart Contract)- 从零构建和部署去中心化投票App,decentralization Voting Dapp
- NSFZOJ #1057. 【NOIP2015】信息传递
- Linux ALSA音频应用
- Java中可作为gc root 的对象有哪些?
- Where to Run LightOJ