原创 【leetcode】#數組【Python】48. Rotate Image 旋轉圖像 zip

鏈接: https://leetcode-cn.com/problems/rotate-image/ 題目: 給定一個 n × n 的二維矩陣表示一個圖像。 將圖像順時針旋轉 90 度。 說明: 你必須在原地旋轉圖像,這意味

原创 【leetcode】#數組【Python】78. Subsets 子集 位運算

鏈接: https://leetcode-cn.com/problems/subsets/ 題目: 給定一組不含重複元素的整數數組 nums,返回該數組所有可能的子集(冪集)。 說明:解集不能包含重複的子集。 示例: 輸

原创 數據庫執行.sql文件導入數據庫

當下載了別人的.sql代碼需要導入數據庫的操作: 創建數據庫 登錄數據庫:cmd中mysql -uxxx -rxxx 創建數據庫:create database xxx; 使用數據庫:use xxx; 執行.sql文件 sour

原创 【leetcode】#數組【Python】12. Integer to Roman 整數轉羅馬數字

鏈接: https://leetcode-cn.com/problems/integer-to-roman/submissions/ 題目: 羅馬數字包含以下七種字符: I, V, X, L,C,D 和 M。 字符

原创 【leetcode】#數組【Python】11. Container With Most Water 盛最多水的容器

鏈接: https://leetcode-cn.com/problems/container-with-most-water/ 題目: 給定 n 個非負整數 a1,a2,…,an,每個數代表座標中的一個點 (i, ai) 。在

原创 【leetcode】#數組【Python】13. Roman to Integer 羅馬數字轉整數

鏈接: https://leetcode-cn.com/problems/roman-to-integer/ 題目: 給定一個羅馬數字,將其轉換成整數。輸入確保在 1 到 3999 的範圍內。 示例 1: 輸入: “III”

原创 【leetcode】#字符串#數學【Python】7. Reverse Integer 整數反轉

鏈接: https://leetcode-cn.com/problems/reverse-integer/ 題目: 給出一個 32 位的有符號整數,你需要將這個整數中每位上的數字進行反轉。 示例 1: 輸入: 123 輸出:

原创 【leetcode】#數組【Python】8. String to Integer (atoi) 字符串轉換整數 (atoi)

鏈接: https://leetcode-cn.com/problems/string-to-integer-atoi/ 題目: 請你來實現一個 atoi 函數,使其能將字符串轉換成整數。 首先,該函數會根據需要丟棄無用的開

原创 【leetcode】#字符串【Python】6.ZigZag Conversion Z 字形變換

鏈接: https://leetcode-cn.com/problems/zigzag-conversion/ 題目: 將一個給定字符串根據給定的行數,以從上往下、從左到右進行 Z 字形排列。 比如輸入字符串爲 “LEETC

原创 【leetcode】#數組【Python】9. Palindrome Number 迴文數

鏈接: https://leetcode-cn.com/problems/palindrome-number/ 題目: 判斷一個整數是否是迴文數。迴文數是指正序(從左向右)和倒序(從右向左)讀都是一樣的整數。 示例 1: 輸

原创 【leetcode】#字符串【Python】5. Longest Palindromic Substring 最長迴文子串

鏈接: https://leetcode-cn.com/problems/longest-palindromic-substring/ 題目: 給定一個字符串 s,找到 s 中最長的迴文子串。你可以假設 s 的最大長度爲 10

原创 【leetcode】#【Python】4. Median of Two Sorted Arrays尋找兩個有序數組的中位數

鏈接: https://leetcode-cn.com/problems/median-of-two-sorted-arrays/ 題目: 給定兩個大小爲 m 和 n 的有序數組 nums1 和 nums2。 請你找出這兩個

原创 【leetcode】#鏈表【Python】2. Add Two Numbers兩數相加

鏈接: https://leetcode-cn.com/problems/add-two-numbers/ 題目: 給出兩個 非空 的鏈表用來表示兩個非負的整數。其中,它們各自的位數是按照 逆序 的方式存儲的,並且它們的每個節

原创 【leetcode】#數組#哈希表【Python】1. Two Sum兩數之和

鏈接: https://leetcode-cn.com/problems/two-sum/submissions/ 題目: 給定一個整數數組 nums 和一個目標值 target,請你在該數組中找出和爲目標值的兩個整數。 你

原创 【leetcode】#哈希表#字符串【Python】3. Longest Substring Without Repeating Characters 無重複字符的最長子串

鏈接: https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/ 題目: 給定一個字符串,請你找出其中不含有重複字符的 最