Yosgi
Yosgi
Avatar
😀
3d ai agents ai engineering ai systems algorithms algorithms array binary search tree binary tree css design pattern digital twin digital twins engineering frontend investing investing javascript javascript leetcode life linked list mcp mongodb network node.js performance optimization product engineering projects queue react sorting stack string vue web development web performance
  • The first thing I thought of was to construct a binary tree, and then use the symmetric relationship of each layer to find the parent node var pathInZigZagTree = function(label) { let stack = [] for …
    Algorithms Created Thu, 29 Jul 2021 00:00:00 +1200
  • I didn’t think of any good way to get it, so I used brute force to solve it first. var isCovered = function(ranges, left, right) { for(let i = left ; i <= right ; i ++) { let include = false for(let …
    Algorithms Created Fri, 23 Jul 2021 00:00:00 +1200
  • Considering that the head may also be reversed, a dummy head is needed. During the traversal process, the tail node after the reversal and the previous node are recorded. Finally, the node link …
    Algorithms Created Fri, 23 Jul 2021 00:00:00 +1200
  • The idea behind the question is to use double pointers to point to the old and new nodes, and then add a map to map the old and new nodes. recursion var listMap = new Map() var copyRandomList = …
    Algorithms Created Thu, 22 Jul 2021 00:00:00 +1200
  • Time: 15 minutes Use the union-find template var findRedundantConnection = function(edges) { var n = edges.length var fa = new Array(n + 1) var find = function (x) { if (x != fa[x]) { fa[x] = …
    Algorithms Created Wed, 07 Jul 2021 00:00:00 +1200
  • It is mainly used for learning and checking ideas, and you will start only after looking at the answers. The idea is to group the interchangeable strings first, sort the groups, and then combine them …
    Algorithms Created Tue, 06 Jul 2021 00:00:00 +1200
  • Time: 20 minutes First of all, it can be seen that this is a question to examine DFS var swimInWater = function(grid) { let row = grid.length; let col = grid[0].length; var step = 0 while(true) { …
    Algorithms Created Mon, 05 Jul 2021 00:00:00 +1200
  • The first thing that comes to mind is to find the distance r of all heaters that are the shortest distance from the house, and then return the largest r var findRadius = function(houses, heaters) { …
    Algorithms Created Thu, 10 Jun 2021 00:00:00 +1200
  • Time: 60 minutes The quickest way of thinking when getting the question is to enumerate all the speeds at which bananas can be eaten and find the minimum speed at which all bananas can be eaten. The …
    Algorithms Created Wed, 28 Apr 2021 00:00:00 +1200
  • Time: 15 minutes There is nothing much to say about conventional heap sort class Heap { constructor(list, compare = (a, b) => a - b) { this.left = index => 2 * index + 1 this.right = index => 2 * …
    Algorithms Created Sat, 10 Apr 2021 00:00:00 +1200
Next