Home
Atelier Chikuma
Cancel

Leetcode 2368 - Reachable Nodes With Restrictions

Link to problem Problem There is an undirected tree with n nodes labeled from 0 to n - 1 and n - 1 edges. You are given a 2D integer array edges of length n - 1 where edges[i] = [ai, bi] indicat...

Leetcode 81 - Search in Rotated Sorted Array II

Link to problem Problem There is an integer array nums sorted in non-decreasing order (not necessarily with distinct values). Before being passed to your function, nums is rotated at an unknown ...

Leetcode 769 - Max Chunks To Make Sorted

Link to problem Problem You are given an integer array arr of length n that represents a permutation of the integers in the range [0, n - 1]. We split arr into some number of chunks (i.e., parti...

Leetcode 2316 - Count Unreachable Pairs of Nodes in an Undirected Graph

Link to problem Problem You are given an integer n. There is an undirected graph with n nodes, numbered from 0 to n - 1. You are given a 2D integer array edges where edges[i] = [ai, bi] denotes t...

Leetcode 347 - Top K Frequent Elements

Link to problem Problem Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order. Solution I have two slightly different solutio...

Leetcode 1895 - Largest Magic Square

Link to problem Problem A k x k magic square is a k x k grid filled with integers such that every row sum, every column sum, and both diagonal sums are all equal. The integers in the magic square...

Third Parties and FFXIV

Recently, a footage showing world first clear of The Omega Protocol using plugins that could zoom in sparked the discussion of the use of third party tools (again). The problem was solved by SE in ...

Amtrak Trip to Michigan

Last year, I went to Michigan to visit a friend during holiday season. But why not spending the time with my family? Well, plane ticket back to my hometown costs too much. And for the same reason, ...

Leetcode 56 - Merge Intervals

Link to Problem Problem Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the i...

Leetcode 495 - Teemo Attacking

Link to problem Problem Our hero Teemo is attacking an enemy Ashe with poison attacks! When Teemo attacks Ashe, Ashe gets poisoned for a exactly duration seconds. More formally, an attack at seco...