class Solution { static int[] dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1}; int n, m; public void solve(char[][] board) { // flood fill algorithm. (dfs / bfs) if (board.length == 0) return ; n = board.length; m = board[0].length; // Start dfs from edges. Fin...
Leetcode Daily Challenge (Nov.) 11.1 (DFS, BFS) class Solution { static int[] dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1}; int n,…阅读全文 赞同 添加评论 分享收藏 leetcode 31~40(更新ing) class Solution { public: void nextPermutation(vector<int>& nums...
// 我的LeetCode题解代码仓:https://github.com/Chanmoey/play-leetcode-noteclassSolution{public StringremoveDuplicates(String s,int k){Deque<Character>stack=newLinkedList<>();char[]chars=s.toCharArray();int dup=0;for(char aChar:chars){// 栈空单独考虑if(stack.isEmpty()){stack.addLast(aChar...
# HTTP POST to https://leetcode.com/graphql query questionOfToday { activeDailyCodingChallengeQuestion { date userStatus link question { acRate difficulty freqBar frontendQuestionId: questionFrontendId isFavor paidOnly: isPaidOnly status title titleSlug hasVideoSolution hasSolution topicTags { name...
LeetCode Big O Notebookfor a user that activelyshare high-quality solution posts. LeetCoinsfor users that give high qualityupvote/discuss! 📌 Missed a challenge? Use the Time Travel Ticket! Do you have experience trying to keep a streak but failed because you missed one of the challenges?
DailyChallenge 63. 不同路径 II 20200706 难度:中等 题目描述 一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为“Start” )。 机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角(在下图中标记为“Finish”)。 现在考虑网格中有障碍物。那么从左上角到右下角将会有多少条不同...
🐼 A daily journey of honing my programming skills and documenting my insights solutions and std solutions. I categorize problems based on their optimal solution algorithm. If there's no fixed algorithm, I label it as a trick (requiring creativity, no template algorithm). If a problem isn't...
Track Progress: Each solution reflects my daily efforts to tackle LeetCode challenges, helping me improve my problem-solving skills. Organized Solutions: Solutions are stored in an easily navigable structure for quick access and understanding. Learning Resource: This repository serves as a learning tool...
DailyChallenge 70. 爬楼梯 Easy20200613 Description 假设你正在爬楼梯。需要 n 阶你才能到达楼顶。 每次你可以爬 1 或 2 个台阶。你有多少种不同的方法可以爬到楼顶呢? 注意:给定 n 是一个正整数。 示例1: 输入:2输出:2解释: 有两种方法可以爬到楼顶。1.1阶+1阶2.2阶 ...
DailyChallenge 134. 加油站 Medium20201118 Description 在一条环路上有 N 个加油站,其中第 i 个加油站有汽油 gas[i] 升。 你有一辆油箱容量无限的的汽车,从第 i 个加油站开往第 i+1 个加油站需要消耗汽油 cost[i] 升。你从其中的一个加油站出发,开始时油箱为空。