current position：Home>About the rotation matrix on leetcode!
About the rotation matrix on leetcode!
2022-02-03 00:55:34 【CSDN Q & A】
I can't figure out what went wrong
class Solution: def rotate(self, matrix: List[List[int]]) -> None: """ Do not return anything, modify matrix in-place instead. """ j=i=0 matrix_1=matrix n=len(matrix) while i<n: while j<n: (matrix_1[i])[j]=(matrix[j])[n-i-1] j+=1 i+=1 matrix=matrix_1
My solution ideas and tried methods
What I want to achieve
Refer to the answer 1：
I uploaded the wrong code I'll upload it again
class Solution: def rotate(self, matrix: List[List[int]]) -> None: """ Do not return anything, modify matrix in-place instead. """ j=i=0 matrix_1=matrix n=len(matrix) while i<n: while j<n: (matrix_1[i])[j]=(matrix[n-1-j])[i] j+=1 j=0 i+=1 matrix=matrix_1
Refer to the answer 2：
author[CSDN Q & A],Please bring the original link to reprint, thank you.
The sidebar is recommended
- MySQL reports an error in Navicat. How to solve it?
- Router link cannot jump into router view (Vue)
- Why is the camera preview frame obtained by Android like this
- How to implement JS? The address bar changes the page load and refresh, and the selected conditions of the current page remain unchanged as all by default
- Why did 0.3 become 0.2999999999
- What is the reason for the warning when Vue project is packaged
- Yolov5 deployment final inference report cannot find picture
- How to extract the characters of a paragraph in Notepad?
- Computer network technology IP questions
- MySQL group query gets the data of the first 24 hours in each group
guess what you like
What's wrong with this and need to be changed?
Write a program to find the number of integers between 200 and 300 that meet the following conditions. Condition: the product of hundreds, tens and individuals is equal to the sum of hundreds, tens and individuals
In Python, the condition setting and interpretation of while loop
How can jupyter notebook run on the next line of code followed by the above code
The page has been loaded. Press F12 at the top to show it. What's going on
This CompareTo method is not called. How do you sort the elements in the collection
Using pointer method: input three integers ABC and output them in order of size
C ＃ new ADO Net data model, error, failed to load file or assembly
Input n integers from the keyboard and store them in a pile of arrays. Put all positive numbers in the array in front of the array and negative numbers in the back to output the array
Why can't the small gourd be installed.
- Java byte array and string conversion
- Definition of two-dimensional array in C language
- Why is there an extra 0 here?
- Python code programs don't
- Measure the distance with sound wave, and then send the result to the serial port. Do you want to interrupt twice, language interrupt, and ask for an idea
- An error occurs when starting Hadoop. How to solve it?
- What about the problem of remote access server?
- pywintypes. com_ Error: (- 2147023728, 'element not found', none, none)
- Global variables don't work in this program? Why is the answer a
- In Python, there is something wrong with the program and an error is reported
- Simple OJ questions for Freshmen
- Butterfly effect problem, insufficient number of input parameters
- Use of extractall function of Python zipfile module
- After spring imports the database and c3p0 dependency package in idea, it will prompt the database for abnormal error
- Python from introduction to practice 5-10
- 1703792 what does that mean? What's wrong?
- C language and C + are easy to search dogs
- This interface is always used when I use CONDA to install tensorflow? About half an hour. How?
- React summernote rich text editor!! Why do some function icons of rich text editor fail after I pack them
- How does silly girl robot log in with mobile phone
- Why can't I see the absolute path of the command
- Pycharm uses the requests crawler to report the wrong requests exceptions. SSLError: HTTPSConnectionPool
- How to run multiple sleep () simultaneously in C language
- The data requested by Axios in vue3 is put into ecarts, which always shows that setoption is not defined
- What do these two for loops mean
- Java judges whether there are 30 consecutive int arrays with a length of 1000 as the growth trend
- Force deduction 221 question maximum square
- When I set this layout, I prompted an error from line 18
- The import javax. security. auth. message cannot be resolved
- The hottest Christmas tree code. one hundred and twenty-three
- Open the edge browser and display "what if I can't access this page?"?
- Running problems of java simple supermarket system
- Is the data  here an address or an element? The concept is always unclear
- Python crawling news content
- How to deal with the problem of general code framework
- Bubble sort, how can there be an extra number in front
- The graph drawing algorithm of Python is described by Raptor flow chart software
- Numpy creates an array of the specified data range
- Python crawler obtains the data of Douban movie top250 fantasy class
- R7-2 minimum spanning tree construction (25 points)