From 710a723263b0fb6c3236b076e310e4d49d7337b1 Mon Sep 17 00:00:00 2001 From: priyal Date: Wed, 5 Oct 2022 19:57:27 +0530 Subject: [PATCH] added rotate image in c++ --- Medium/rotate_image.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Medium/rotate_image.cpp diff --git a/Medium/rotate_image.cpp b/Medium/rotate_image.cpp new file mode 100644 index 0000000..3c454a8 --- /dev/null +++ b/Medium/rotate_image.cpp @@ -0,0 +1,18 @@ +//find rotate image +// Input: matrix = [[1,2,3],[4,5,6],[7,8,9]] +// Output: [[7,4,1],[8,5,2],[9,6,3]] +// ques link- https://leetcode.com/problems/rotate-image/description/ +class Solution { +public: + void rotate(vector>& matrix) { + + int n=matrix.size(); + + for(int i=0;i