原创 LeetCode 5 — Longest Palindromic Substring(最長迴文子串)

Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.

原创 LeetCode 7 — Reverse Integer(反轉整數)

Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -1

原创 LeetCode 4 — Median of Two Sorted Arrays(兩個排序數組的中位數)

There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays.

原创 LeetCode 12 — Integer to Roman(整數轉羅馬數字)

Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I

原创 LeetCode—51.N皇后

文章同步發佈在我的個人博客(zhuoerhuobi.cn) n 皇后問題研究的是如何將 n 個皇后放置在 n×n 的棋盤上,並且使皇后彼此之間不能相互攻擊。 (上圖爲 8 皇后問題的一種解法。) 給定一個整數 n,返回所有

原创 LeetCode 6 — ZigZag Conversion(Z字形變換)

The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to di

原创 LeetCode 2 — Add Two Numbers(兩數相加)

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse o

原创 SpringSecurity實現用戶認證授權系統

本文同步發佈在是與非博客(www.zhuoerhuobi.cn) 隨着是與非博客基礎功能的完善,給我的網站加上用戶認證授權系統這件事終於是提上日程了。 用戶系統我們可以拆解爲登錄認證和授權訪問這兩個功能。我們先登陸賬號,用戶的

原创 springboot+thymeleaf實現博客歸檔功能

文章同步發佈在我的個人博客(zhuoerhuobi.cn) 隨着博客數量的增多,對於系統來說,一個歸檔功能顯得必不可少。以下是基於springboot開發的按時間倒序的歸檔功能。 1、後端數據邏輯 首先如果能夠提前在建文章表

原创 IDEA創建多模塊SpringBoot項目

更好的閱讀體驗,請前往我的個人博客(www.zhuoerhuobi.cn) eclipse的工程有workspace的概念,在一個workspace下可以有多個project。即一個工程下可以有多個子項目,有利於將工程切分成不同的

原创 LeetCode 9 — Palindrome Number(迴文數)

Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward

原创 LeetCode 8 — String to Integer (atoi)(字符串轉整數 (atoi))

Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as

原创 大數開方

由於Java內置Biginteger,但是卻沒有開方的接口,不得不自己動手寫,在網上學習了,先根據被開方數位數確定開方後數的位數,在自高位枚舉逼近待開方數,最後求得開方結果。 public static BigInteger sq

原创 還是得先學基礎課程啊 雜談

最近興致勃勃買了服務器和域名,要搭一個個人博客網站。由於有tornado開發的經驗,想自己學習一下Django,就用了Django。想法是美好的,行動起來卻是困難重重。這次沒有了學姐學長的幫助,自己真是一步一個問題。雖然通過谷歌這

原创 藍橋杯歷屆試題 格子刷油漆

問題描述   X國的一段古城牆的頂端可以看成 2*N個格子組成的矩形(如下圖所示),現需要把這些格子刷上保護漆。   你可以從任意一個格子刷起,刷完一格,可以移動到和它相鄰的格子(對角相鄰也算數),但不能移動到較遠的格子(因