1.1k 1 分鐘

⭐️⭐️⭐️⭐️ # 題目敘述 Given an m x n binary matrix mat , return the distance of the nearest 0 for each cell. The distance between two adjacent cells is 1 . # Example 1 Input: mat = [[0,0,0],[0,1,0],[0,0,0]] Output: [[0,0,0],[0,1,0],[0,0,0]] # Example 2 Input: mat = [[0,0,0],[0,1,0],[1,1,1]] Output:...
1.5k 1 分鐘

⭐️⭐️⭐️⭐️⭐️ # 題目敘述 You are given an array of integers nums , there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. Return the max sliding window. #...
1.5k 1 分鐘

⭐️⭐️ # 文法摘要 主詞是第三人稱單數 (he, she, it) 且為現在式,使用的動詞字尾上必須加 "-s" 或 "-es",規則如下: 動詞規則改法 範例 動詞字尾加上 s hit - hits 動詞結尾是 e,加上 s hide - hides 動詞字尾是 s/o/x/z/ch/sh,加上 es catch - catches 動詞字尾為 「母音 + y」,只要加 s stay - stays 動詞字尾為 「子音 + y」,要去 y 加上 ies study -...
1.3k 1 分鐘

⭐️⭐️⭐️ # 題目敘述 Given the head of a linked list and a value x , partition it such that all nodes less than x come before nodes greater than or equal to x . You should preserve the original relative order of the nodes in each of the two partitions. # Example 1 Input: head = [1,4,3,2,5,2], x =...
1.1k 1 分鐘

⭐️⭐️ # 題目敘述 Given an integer array nums and an integer k , return the kth largest element in the array. Note that it is the kth largest element in the sorted order, not the kth distinct element. Can you solve it without sorting? # Example 1 Input: nums = [3,2,1,5,6,4], k = 2 Output: 5 # Example...
2.6k 2 分鐘

⭐️⭐️⭐️ # 題目敘述 You are given a 0-indexed integer array nums . You have to partition the array into one or more contiguous subarrays. We call a partition of the array valid if each of the obtained subarrays satisfies one of the following conditions: The subarray consists of exactly 2 equal elements....
2.5k 2 分鐘

ChienI Kao 筆記網站 JHTNT 筆記網站 # 認識 UML # 統一建模語言 UML (Unified Modeling Language) 是建構模式 (model) 的專用語言。 在編寫程式碼前,開發人員會先經過分析設計的思考,並繪製一些圖形,再搭配一些文字,作為分析設計的產出,這份產出可稱之為軟體模式模型。 # UML 圖 UML 推出了十多款圖,不過並非每款圖都實用,在開發商用資訊系統時,最常用到的 UML 圖,包含有:類別圖、循序圖、使用案例圖、狀態圖 (state machine diagram) 和活動圖 (activity diagram)。 #...
2.8k 3 分鐘

ChienI Kao 筆記網站 JHTNT 筆記網站 # Array 變數可以幫我們存取一筆資料,但要存取多筆資料時就會顯得很麻煩。 比如我們要記錄三個學生的成績: # Declare Data type 變數名稱[陣列大小] = {資料}; # Array Input/Output # Two-dimensional Arrays 二維陣列 陣列裡面存放陣列 # Declare Data type 變數名稱[column][row] = <!--swig1-->; # Two-dimensional Arrays...
3.3k 3 分鐘

ChienI Kao 筆記網站 JHTNT 筆記網站 # Get Start 前情提要 Program language C C++ Java JavaScript Python Source-code Editor VS code dev c++ Code::Block notepad++ Compiler # Introduction 介紹 雖然他是一個很古老的語言,也相較底層,但到如今還是一個相當熱門的語言。 他是很多語言的基礎,學習 C 語言後,在學習其他語言,會更加容易上手。 C 語言 與 UNIX 密切相關,因為它是為編寫 UNIX 作業系統而開發的。 C 語言...
10k 10 分鐘

ChienI Kao 筆記網站 JHTNT 筆記網站 # 與資料庫的結合運用 在 PHP 中連結資料庫 all.php<?php require '../header.php'; ?><?php$pdo=new PDO('mysql:host=localhost;dbname=shop;charset=utf8', '帳號', '密碼');?><?php require '../footer.php';...