此主題將有三位參賽者共同參與,我們將合力完成三方共 90篇的鐵人文章(Java刷題A/B和C++刷題)。根據LeetCode Top 100 Liked題目集的脈絡,我們將介紹共十四種演算法,並透過Java和C++實作LeetCode上的題目。
矩陣(Matrix),是由數字或其他類型的數據按行與列排列而成的的矩形數組,通常用 mXn 來表示,其中m是行數,n是列數,矩陣的元素通常用 a(i, j) 來...
Problem : You are given an n x n 2D matrix representing an image, rotate the ima...
Problem : Given an m x n integer matrix matrix, if an element is 0, set its enti...
Problem : Write an efficient algorithm that searches for a value target in an m...
貪婪演算法(Greedy),是在每一步選擇中都選擇最佳的選項而希望導致結果為最好的演算法,這種演算法再解決有最佳子結構的問題時能得到良好的效率,與動態規劃不同的...
Problem : You are given an integer array nums. You are initially positioned at t...
Problem : You are given a 0-indexed array of integers nums of length n. You are...
Problem : You are given an array prices where prices[i] is the price of a given...
Problem : Given an integer array nums, find the subarray with the largest sum, a...
這次鐵人賽的題目我選擇leetcode刷題的原因是為了讓自己能更熟悉演算法的使用,根據LeetCode Top 100 Liked題目集的脈絡複習和學習新的演算...