All Posts
Leetcode 1642: Furthest Building You Can Reach
heights
representing the heights of buildings, along with a certain number of bricks and ladders. Your task is to determine the furthest building you can reach by optimally using bricks and ladders.
You are given an array Leetcode 1646: Get Maximum in Generated Array
Given an integer n, an array nums of length n+1 is generated with the following rules:
- nums[0] = 0
- nums[1] = 1
- nums[2 * i] = nums[i] when 2 <= 2 * i <= n
- nums[2 * i + 1] = nums[i] + nums[i + 1] when 2 <= 2 * i + 1 <= n
Return the maximum value in the array nums.