原创 LintCode 480-二叉樹的所有路徑

後序遍歷非遞歸,當遍歷到葉子結點時,將棧中所有的內容都按照格式要求生成列表返回。 static List<String> ret=new ArrayList<>();//全局變量 static public List<

原创 python 自動提醒黑龍江招生信息網考研成績 小程序

本人報考哈工大計算機專業,因爲成績公示未公佈明確的查詢時間,心慌之下寫了小的查詢程序。 注:1. 在彈窗提示的手段裏,可以自己填寫,簡單的如彈出記事本,複雜的如直接彈出web(需要提前安裝selenium庫) 2. header裏的coo

原创 leetcode 657. 判斷路線成圈

我用了字典的方式來做這題,挺好玩的題目class Solution: def judgeCircle(self, moves): """ :type moves: str :rtyp

原创 Leetcode 38. 數數並說

class Solution: def countAndSay(self, n): """ :type n: int :rtype: str """

原创 lintCode 搜索插入位置

public int searchInsert(int[] A, int target) { // write your code here for(int i=0;i<A.length;i++){

原创 python leetcode 258. 各位相加

人生苦短,我用python我感覺我這種做法太邪惡了。。。class Solution: def addDigits(self, num): """ :type num: int :r

原创 leetcode 575. 分糖果

class Solution(object): def distributeCandies(self, candies): """ :type candies: List[int]

原创 LintCode 二叉樹的最大節點

static int i; static TreeNode p; static public TreeNode maxNode(TreeNode root) { // write your c

原创 LintCode 95-驗證二叉查找樹

static ArrayList<Integer> list=new ArrayList<>();//全局變量 static public boolean isValidBST(TreeNode root) {

原创 python WiFi暴力破解小程序

思路:  1、掃描前十個信號最好的wifi,得到ssid 2、然後用一個密碼,遍歷所有ssid,嘗試能否連接上 3、密碼正確連接上後,會報錯退出程序,否則會一直運行下去 4、本腳本沒有優化,運行時可能有bug 5、時間大概是2~3秒

原创 Leetcode 404. 左葉子之和

這道題看到了解法又讓我感受到了編程之美。教會了我雖然框架能讓人很快寫出代碼,但是真正優秀的代碼總是能夠不被框架約束!參考了向北的稻草 的博客class Solution: def sumOfLeftLeaves(self, ro

原创 Python 知乎知識之王答題輔助程序不完全版

使用了以下軟件:1、雷電安卓模擬器+知乎最新版apk  用來截圖 2、tesseract  用來將圖片轉換成了文字 3、selenium操作chrome瀏覽器搜索答案 注:這是不實用的版本,因爲知乎只給10s的反應時間,而程序大概要跑7

原创 leetcode 669. 修剪二叉搜索樹

class Solution(object): def trimBST(self, root, L, R): """ :type root: TreeNode :type L: i

原创 leetcode 806. 寫字符串需要的行數

class Solution(object): def numberOfLines(self, widths, S): """ :type widths: List[int] :ty

原创 LintCode 166-倒數第k個節點

《王道數據結構》給出的快慢指針,真是一個不錯的好方法啊! static public ListNode nthToLast(ListNode head, int n) { // write your code