Subject link: https://leetcode-cn.com/problems/transpose-matrix/
Given a matrix A, return the transpose matrix of A.
The transposition of a matrix refers to flipping the main diagonal o
Subject link: https://leetcode-cn.com/problems/transpose-matrix/
Given a matrix A, return the transpose matrix of A.
The transposition of a matrix refers to flipping the main diagonal o
Question: Integer to Roman Numerals
Question solution: The range is limited to 0-3999, hard-coded is good–too lazy to think about logic
class Solution {
public:
string intToRoman(in
12. Integer to Roman (integer to Roman numeral)
Link: https://leetcode-cn.com/problems/integer-to-roman /
Title:
Roman numerals contain the following seven characters: I, V, X, L,
This question is not difficult, it is a tricky thing.
public class integerToRoman12 {
public String intToRoman(int< /span> num) {
StringBuilder sb = new StringBuilder();
int[] values = {
problem
Remove Duplicates from Sorted List
The basic usage of linked list is investigated.
code
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
26. Remove Duplicates from Sorted Array Easy 1591 3410 Favorite Share < div> Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the
mycode 42.30%,
Note: If the symbol is not considered, -1//3=-1 instead of 0, because it is rounded down
class Solution(object):
def evalRPN(self, tokens):
“””
:type tokens: List[s
Hahahahahahaha, I’m so happy, today’s code time and memory consumption are half of the official code haha
(Because the official code is written in C#, I use C++, manual dog head)
Title<
In a 2D grid of?0s and?1s, we change at most one?0< /code>?to a?1.
After, what is the size of the largest island??(An island is a 4-directionally connected group of? 1s).
Example 1:
class Solution {
public:
bool canJump(vector
int len=nums.size();
if(len==1)//Border border border!
return true ;
int max_bianjie=nums[0];//Set a boundary, initialized t